From 23ff76544e31d464e4874a4e968c5623a7a6fc16 Mon Sep 17 00:00:00 2001 From: Enol Fernandez Date: Thu, 23 May 2024 17:07:08 +0100 Subject: [PATCH] Fix tests --- cloud-info/cloud_info_catchall/test_token_generator.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cloud-info/cloud_info_catchall/test_token_generator.py b/cloud-info/cloud_info_catchall/test_token_generator.py index e2b6e50d..6edff075 100644 --- a/cloud-info/cloud_info_catchall/test_token_generator.py +++ b/cloud-info/cloud_info_catchall/test_token_generator.py @@ -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__":