Skip to content

Commit

Permalink
Update assert (#2799)
Browse files Browse the repository at this point in the history
* Update version to dummy 1.0.0.0'

* Revert version change

* Update test_download_fail assertion
  • Loading branch information
maddieford authored Apr 7, 2023
1 parent 1601e88 commit c89647c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/ga/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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")

Expand Down

0 comments on commit c89647c

Please sign in to comment.