From bcda7c1625c50f2530cfb765bd1b4fe536ab3b03 Mon Sep 17 00:00:00 2001 From: Maddie Ford Date: Wed, 30 Aug 2023 14:56:30 -0700 Subject: [PATCH] download_fail unit test should use agent version in common instead of 9.9.9.9 --- tests/ga/test_guestagent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/ga/test_guestagent.py b/tests/ga/test_guestagent.py index a127341d15..3d25ff7921 100644 --- a/tests/ga/test_guestagent.py +++ b/tests/ga/test_guestagent.py @@ -173,6 +173,7 @@ def http_get_handler(uri, *_, **__): return MockHttpResponse(status=httpclient.SERVICE_UNAVAILABLE) return None + agent_version = self._get_agent_version() pkg = ExtHandlerPackage(version=str(self._get_agent_version())) pkg.uris.append(agent_uri) @@ -185,7 +186,7 @@ def http_get_handler(uri, *_, **__): messages = [kwargs['message'] for _, kwargs in add_event.call_args_list if kwargs['op'] == 'Install' and kwargs['is_success'] == False] self.assertEqual(1, len(messages), "Expected exactly 1 install error/ Got: {0}".format(add_event.call_args_list)) - self.assertIn('[UpdateError] Unable to download Agent WALinuxAgent-9.9.9.9', messages[0], "The install error does not include the expected message") + self.assertIn(str.format('[UpdateError] Unable to download Agent WALinuxAgent-{0}', agent_version), messages[0], "The install error does not include the expected message") self.assertFalse(agent.is_blacklisted, "Download failures should not blacklist the Agent")