Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update assert #2799

Merged
merged 11 commits into from
Apr 7, 2023
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