Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2021-11-22 17:54:42 +0300
committerGhostkeeper <rubend@tutanota.com>2021-11-22 17:54:42 +0300
commit4b5d698325e4ef9249c8df4ce74bba0a8aba55fa (patch)
tree65b54a719c3caaec4356b364aac629250e148989 /tests
parentfbbf1427b3d46a2fa1e2598782e609907ebb58bf (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')
-rw-r--r--tests/TestOAuth2.py8
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()