diff --git a/swh/auth/pytest_plugin.py b/swh/auth/pytest_plugin.py --- a/swh/auth/pytest_plugin.py +++ b/swh/auth/pytest_plugin.py @@ -147,6 +147,7 @@ self.refresh_token.side_effect = exception self.userinfo.side_effect = exception self.logout.side_effect = exception + self.login.side_effect = exception def keycloak_mock_factory( diff --git a/swh/auth/tests/test_keycloak.py b/swh/auth/tests/test_keycloak.py --- a/swh/auth/tests/test_keycloak.py +++ b/swh/auth/tests/test_keycloak.py @@ -53,6 +53,9 @@ with pytest.raises(KeycloakError): keycloak_mock.authorization_code("auth-code", "redirect-uri") + with pytest.raises(KeycloakError): + keycloak_mock.login("username", "password") + def test_keycloak_authorization_code(keycloak_mock): actual_response = keycloak_mock.authorization_code("auth-code", "redirect-uri")