Skip to content

Commit 5d6a96e

Browse files
committed
test: Add test
1 parent 42b8dc4 commit 5d6a96e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/sessions/claims/test_assert_claims.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
)
1717
from supertokens_python.recipe.session.session_class import Session
1818
from supertokens_python import init
19-
from tests.utils import setup_function, teardown_function, start_st, st_init_common_args
19+
from tests.utils import get_st_init_args, setup_function, teardown_function, start_st, st_init_common_args
20+
from supertokens_python.recipe.session.asyncio import create_new_session_without_request_response
21+
from .utils import TrueClaim
2022

2123
_ = setup_function # type:ignore
2224
_ = teardown_function # type:ignore
@@ -125,3 +127,12 @@ def should_refetch(self, payload: JSONObject, user_context: Dict[str, Any]):
125127

126128
assert dummy_claim_validator.validate_calls == {json.dumps(payload): 1}
127129
mock.assert_not_called()
130+
131+
132+
async def test_assert_claims_should_work():
133+
init(**get_st_init_args([session.init()]))
134+
start_st()
135+
136+
validator = TrueClaim.validators.is_true(1)
137+
s = await create_new_session_without_request_response("public", "userid", {})
138+
await s.assert_claims([validator])

0 commit comments

Comments
 (0)