Skip to content

Commit

Permalink
download_fail unit test should use agent version in common instead of…
Browse files Browse the repository at this point in the history
… 9.9.9.9 (Azure#2908)
  • Loading branch information
maddieford committed Aug 30, 2023
1 parent 2a5d686 commit ed80388
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/ga/test_guestagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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")

Expand Down

0 comments on commit ed80388

Please sign in to comment.