From 69b5d7b5aad949bbea9e7a5ced78253c8d266d04 Mon Sep 17 00:00:00 2001 From: Mayank Thakur Date: Thu, 5 Oct 2023 13:27:49 +0530 Subject: [PATCH] added assert to test if is called. --- tests/thirdparty/test_thirdparty.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/thirdparty/test_thirdparty.py b/tests/thirdparty/test_thirdparty.py index 30b900b66..ee6c36255 100644 --- a/tests/thirdparty/test_thirdparty.py +++ b/tests/thirdparty/test_thirdparty.py @@ -41,6 +41,8 @@ respx_mock = respx.MockRouter +access_token_validated: bool = False + @fixture(scope="function") async def fastapi_client(): @@ -145,7 +147,9 @@ async def valid_access_token( # pylint: disable=unused-argument config: ProviderConfigForClient, user_context: Optional[Dict[str, Any]], ): + global access_token_validated if access_token == "accesstoken": + access_token_validated = True return raise Exception("Unexpected access token") @@ -262,4 +266,5 @@ async def test_signinup_works_when_validate_access_token_does_not_throw( ) assert res.status_code == 200 + assert access_token_validated is True assert res.json()["status"] == "OK"