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

testing: Add responses workaround for focal/impish (SC-954) #1403

Merged
merged 1 commit into from
Apr 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tests/unittests/sources/test_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,14 +540,20 @@ def test_network_config_cached_property_refreshed_on_upgrade(self, m_dhcp):
self.assertTrue(ds.get_data())

# Workaround https://github.com/getsentry/responses/issues/212
# Can be removed when requests < 0.17.0 is no longer tested
# i.e. after Focal is EOL
if hasattr(responses.mock, "_urls"):
# Can be removed when Bionic is EOL
for index, url in enumerate(responses.mock._urls):
if url["url"].startswith(
"http://169.254.169.254/2009-04-04/meta-data/"
):
del responses.mock._urls[index]
elif hasattr(responses.mock, "_matches"):
# Can be removed when Focal and Impish are EOL
for index, response in enumerate(responses.mock._matches):
if response.url.startswith(
"http://169.254.169.254/2009-04-04/meta-data/"
):
del responses.mock._matches[index]

# Provide new revision of metadata that contains network data
register_mock_metaserver(
Expand Down