Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
enolfc committed May 23, 2024
1 parent c5eeec8 commit 23ff765
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cloud-info/cloud_info_catchall/test_token_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@ def test_valid_token_expired_exception(self, m_calendar, m_decode, m_header, m_a
@patch("cloud_info_catchall.token_generator.valid_token")
@patch("cloud_info_catchall.token_generator.get_access_token")
def test_generate_tokens(self, m_get_access, m_valid_token):
tokens = {
"foo": {"client_id": "x", "client_secret": "y", "access_token": "abc"},
"bar": {"client_id": "y", "client_secret": "f", "access_token": "def"},
tokens = {"foo": {"access_token": "abc"}, "bar": {"access_token": "def"}}
secrets = {
"foo": {"client_id": "foo", "client_secret": "secfoo"},
"bar": {"client_id": "bar", "client_secret": "secbar"},
}
secrets = {"foo": {}, "bar": {}}
m_valid_token.side_effect = [True, False]
m_get_access.return_value = "xyz"
tg.generate_tokens(self.OIDC_CONFIG, "abc", tokens, 8, secrets)
m_valid_token.assert_has_calls(
[call("abc", self.OIDC_CONFIG, 8), call("def", self.OIDC_CONFIG, 8)]
)
m_get_access.assert_called_with("https://example.com", "abc", {})
m_get_access.assert_called_with("https://example.com", "abc", secrets["bar"])


if __name__ == "__main__":
Expand Down

0 comments on commit 23ff765

Please sign in to comment.