diff options
author | Ghostkeeper <rubend@tutanota.com> | 2021-11-22 20:45:04 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2021-11-22 20:45:04 +0300 |
commit | 608cce491d82be9b29440e4da7a6a58b5c80d65f (patch) | |
tree | f7bcde5e146fd2a7eec9d754198562bd27f691a7 /tests/API | |
parent | 1cdeb7d56b01cb1a5997874801628aa7195513fd (diff) |
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.
Diffstat (limited to 'tests/API')
-rw-r--r-- | tests/API/TestAccount.py | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/tests/API/TestAccount.py b/tests/API/TestAccount.py index 6780e50b81..1ad73462c2 100644 --- a/tests/API/TestAccount.py +++ b/tests/API/TestAccount.py @@ -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()) |