From 9e6263b1f19960404051b2f2c00c7d5cf62c4cdc Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 21 May 2019 14:56:00 +0200 Subject: [PATCH] Change instances of assert_called_once to assert_called_once_with Grumbles something about python 3.5 and 3.6... --- tests/API/TestAccount.py | 8 ++++---- tests/TestOAuth2.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/API/TestAccount.py b/tests/API/TestAccount.py index 7a9997c771..725028b32c 100644 --- a/tests/API/TestAccount.py +++ b/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(): diff --git a/tests/TestOAuth2.py b/tests/TestOAuth2.py index d4af485130..358ed5afbb 100644 --- a/tests/TestOAuth2.py +++ b/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()