Skip to content

Commit

Permalink
test: Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
KShivendu committed Sep 12, 2023
1 parent 42b8dc4 commit 5d6a96e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/sessions/claims/test_assert_claims.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
)
from supertokens_python.recipe.session.session_class import Session
from supertokens_python import init
from tests.utils import setup_function, teardown_function, start_st, st_init_common_args
from tests.utils import get_st_init_args, setup_function, teardown_function, start_st, st_init_common_args
from supertokens_python.recipe.session.asyncio import create_new_session_without_request_response
from .utils import TrueClaim

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

assert dummy_claim_validator.validate_calls == {json.dumps(payload): 1}
mock.assert_not_called()


async def test_assert_claims_should_work():
init(**get_st_init_args([session.init()]))
start_st()

validator = TrueClaim.validators.is_true(1)
s = await create_new_session_without_request_response("public", "userid", {})
await s.assert_claims([validator])

0 comments on commit 5d6a96e

Please sign in to comment.