mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-03 18:54:31 +08:00
Remove tests checking for data in UserProfile
The UserProfile is being stored in the account with a simple assignment, and these are just some property getters with a fallback. I don't think we need to test that. The actual getting of a user profile (and whether that returns correctly when logged out and such) is already tested as part of the OAuth flow where that code lives. Contributes to issue CURA-8539.
This commit is contained in:
parent
1cdeb7d56b
commit
608cce491d
@ -80,46 +80,6 @@ def test_errorLoginState(application):
|
||||
account._onLoginStateChanged(False, "OMGZOMG!")
|
||||
account.loginStateChanged.emit.called_with(False)
|
||||
|
||||
|
||||
def test_userName(user_profile):
|
||||
account = Account(MagicMock())
|
||||
mocked_auth_service = MagicMock()
|
||||
account._authorization_service = mocked_auth_service
|
||||
mocked_auth_service.getUserProfile = MagicMock(return_value = user_profile)
|
||||
|
||||
assert account.userName == "username!"
|
||||
|
||||
mocked_auth_service.getUserProfile = MagicMock(return_value=None)
|
||||
assert account.userName is None
|
||||
|
||||
|
||||
def test_profileImageUrl(user_profile):
|
||||
account = Account(MagicMock())
|
||||
mocked_auth_service = MagicMock()
|
||||
account._authorization_service = mocked_auth_service
|
||||
mocked_auth_service.getUserProfile = MagicMock(return_value = user_profile)
|
||||
|
||||
assert account.profileImageUrl == "profile_image_url!"
|
||||
|
||||
mocked_auth_service.getUserProfile = MagicMock(return_value=None)
|
||||
assert account.profileImageUrl is None
|
||||
|
||||
|
||||
def test_userProfile(user_profile):
|
||||
account = Account(MagicMock())
|
||||
mocked_auth_service = MagicMock()
|
||||
account._authorization_service = mocked_auth_service
|
||||
mocked_auth_service.getUserProfile = MagicMock(return_value=user_profile)
|
||||
|
||||
returned_user_profile = account.userProfile
|
||||
assert returned_user_profile["username"] == "username!"
|
||||
assert returned_user_profile["profile_image_url"] == "profile_image_url!"
|
||||
assert returned_user_profile["user_id"] == "user_id!"
|
||||
|
||||
mocked_auth_service.getUserProfile = MagicMock(return_value=None)
|
||||
assert account.userProfile is None
|
||||
|
||||
|
||||
def test_sync_success():
|
||||
account = Account(MagicMock())
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user