mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Fix assertion of resulting profile via callback
Needs to work differently with the asynchronous workflow. Contributes to issue CURA-8539.
This commit is contained in:
parent
fbbf1427b3
commit
4b5d698325
@ -297,9 +297,11 @@ def test_loginAndLogout() -> None:
|
|||||||
def test_wrongServerResponses() -> None:
|
def test_wrongServerResponses() -> None:
|
||||||
authorization_service = AuthorizationService(OAUTH_SETTINGS, Preferences())
|
authorization_service = AuthorizationService(OAUTH_SETTINGS, Preferences())
|
||||||
authorization_service.initialize()
|
authorization_service.initialize()
|
||||||
with patch.object(AuthorizationHelpers, "parseJWT", return_value=UserProfile()):
|
|
||||||
authorization_service._onAuthStateChanged(MALFORMED_AUTH_RESPONSE)
|
authorization_service._onAuthStateChanged(MALFORMED_AUTH_RESPONSE)
|
||||||
assert authorization_service.getUserProfile() is None
|
|
||||||
|
def callback(profile):
|
||||||
|
assert profile is None
|
||||||
|
authorization_service.getUserProfile(callback)
|
||||||
|
|
||||||
def test__generate_auth_url() -> None:
|
def test__generate_auth_url() -> None:
|
||||||
preferences = Preferences()
|
preferences = Preferences()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user