From 15c4139f1081b4bfd1d377e4c521a300acaf57fa Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 21 Jul 2026 09:11:41 +0100 Subject: [PATCH] Fix user agent header assertion in tests Originally this was accesss Mock().calls which is ``` >>> import unittest.mock >>> unittest.mock.Mock().calls ``` so this test wasn't asserting anything --- tests/unit/test_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 955e04c2d9..a501ec693b 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -3058,8 +3058,8 @@ def test_includes_user_agent_header(self): ).retrieve_iam_role_credentials() self.assertEqual(self._send.call_count, 3) - for call in self._send.calls: - self.assertTrue(call[0][0].headers['User-Agent'], user_agent) + for call in self._send.call_args_list: + self.assertEqual(call[0][0].headers['User-Agent'], user_agent) def test_non_200_response_for_role_name_is_retried(self): # Response for role name that have a non 200 status code should