diff options
author | Ghostkeeper <rubend@tutanota.com> | 2021-11-22 17:54:42 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2021-11-22 17:54:42 +0300 |
commit | 4b5d698325e4ef9249c8df4ce74bba0a8aba55fa (patch) | |
tree | 65b54a719c3caaec4356b364aac629250e148989 /tests/TestOAuth2.py | |
parent | fbbf1427b3d46a2fa1e2598782e609907ebb58bf (diff) |
Fix assertion of resulting profile via callback
Needs to work differently with the asynchronous workflow.
Contributes to issue CURA-8539.
Diffstat (limited to 'tests/TestOAuth2.py')
-rw-r--r-- | tests/TestOAuth2.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/TestOAuth2.py b/tests/TestOAuth2.py index f34d5dcf5f..cc6dc175f1 100644 --- a/tests/TestOAuth2.py +++ b/tests/TestOAuth2.py @@ -297,9 +297,11 @@ def test_loginAndLogout() -> None: def test_wrongServerResponses() -> None: authorization_service = AuthorizationService(OAUTH_SETTINGS, Preferences()) authorization_service.initialize() - with patch.object(AuthorizationHelpers, "parseJWT", return_value=UserProfile()): - authorization_service._onAuthStateChanged(MALFORMED_AUTH_RESPONSE) - assert authorization_service.getUserProfile() is None + authorization_service._onAuthStateChanged(MALFORMED_AUTH_RESPONSE) + + def callback(profile): + assert profile is None + authorization_service.getUserProfile(callback) def test__generate_auth_url() -> None: preferences = Preferences() |