Skip to content

Commit

Permalink
work around bug in responses: getsentry/responses#212
Browse files Browse the repository at this point in the history
  • Loading branch information
holmanb committed Apr 6, 2022
1 parent 4a99f79 commit cdafd46
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/unittests/sources/test_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,17 @@ def test_network_config_cached_property_refreshed_on_upgrade(self, m_dhcp):
md={"md": old_metadata},
)
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"):
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]

# Provide new revision of metadata that contains network data
register_mock_metaserver(
"http://169.254.169.254/2009-04-04/meta-data/", DEFAULT_METADATA
Expand Down

0 comments on commit cdafd46

Please sign in to comment.