From 5d6a96e14a5ffd1b1c43cafe9382447937c1b889 Mon Sep 17 00:00:00 2001 From: KShivendu Date: Tue, 12 Sep 2023 17:29:33 +0530 Subject: [PATCH] test: Add test --- tests/sessions/claims/test_assert_claims.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/sessions/claims/test_assert_claims.py b/tests/sessions/claims/test_assert_claims.py index 71d955a6e..992ae89c4 100644 --- a/tests/sessions/claims/test_assert_claims.py +++ b/tests/sessions/claims/test_assert_claims.py @@ -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 @@ -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])