diff --git a/tests/ga/test_update.py b/tests/ga/test_update.py index b329bbaa05..1b84d6f1c4 100644 --- a/tests/ga/test_update.py +++ b/tests/ga/test_update.py @@ -556,7 +556,8 @@ def http_get_handler(uri, *_, **__): return MockHttpResponse(status=httpclient.SERVICE_UNAVAILABLE) return None - pkg = ExtHandlerPackage(version=str(self._get_agent_version())) + agent_version = self._get_agent_version() + pkg = ExtHandlerPackage(version=str(agent_version)) pkg.uris.append(agent_uri) with mock_wire_protocol(mockwiredata.DATA_FILE) as protocol: @@ -568,7 +569,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")