Browse Source

Change instances of assert_called_once to assert_called_once_with

Grumbles something about python 3.5 and 3.6...
Jaime van Kessel 5 years ago
parent
commit
9e6263b1f1
2 changed files with 5 additions and 5 deletions
  1. 4 4
      tests/API/TestAccount.py
  2. 1 1
      tests/TestOAuth2.py

+ 4 - 4
tests/API/TestAccount.py

@@ -21,14 +21,14 @@ def test_login():
     account._authorization_service = mocked_auth_service
 
     account.login()
-    mocked_auth_service.startAuthorizationFlow.assert_called_once()
+    mocked_auth_service.startAuthorizationFlow.assert_called_once_with()
 
     # Fake a sucesfull login
     account._onLoginStateChanged(True)
 
     # Attempting to log in again shouldn't change anything.
     account.login()
-    mocked_auth_service.startAuthorizationFlow.assert_called_once()
+    mocked_auth_service.startAuthorizationFlow.assert_called_once_with()
 
 
 def test_initialize():
@@ -37,7 +37,7 @@ def test_initialize():
     account._authorization_service = mocked_auth_service
 
     account.initialize()
-    mocked_auth_service.loadAuthDataFromPreferences.assert_called_once()
+    mocked_auth_service.loadAuthDataFromPreferences.assert_called_once_with()
 
 
 def test_logout():
@@ -54,7 +54,7 @@ def test_logout():
     assert account.isLoggedIn
 
     account.logout()
-    mocked_auth_service.deleteAuthData.assert_called_once()
+    mocked_auth_service.deleteAuthData.assert_called_once_with()
 
 
 def test_errorLoginState():

+ 1 - 1
tests/TestOAuth2.py

@@ -101,7 +101,7 @@ def test_initialize():
     initialize_preferences = MagicMock()
     authorization_service = AuthorizationService(OAUTH_SETTINGS, original_preference)
     authorization_service.initialize(initialize_preferences)
-    initialize_preferences.addPreference.assert_called_once()
+    initialize_preferences.addPreference.assert_called_once_with("test/auth_data", "{}")
     original_preference.addPreference.assert_not_called()