diff options
author | Lars Kellogg-Stedman <lars@redhat.com> | 2017-01-20 16:19:23 -0500 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-01-24 11:47:06 -0500 |
commit | d3fbb5df017c7a6e0eb1a146d970db260932d7e8 (patch) | |
tree | 4e2d47017ece44c76441152ed3f9dfbcdfe21d11 /tests/unittests | |
parent | a3376d45c83e90150d8de79a2b31282a7d760bd7 (diff) | |
download | vyos-cloud-init-d3fbb5df017c7a6e0eb1a146d970db260932d7e8.tar.gz vyos-cloud-init-d3fbb5df017c7a6e0eb1a146d970db260932d7e8.zip |
reset httppretty for each test
this ensures that we call httpretty.reset() before calling
httppretty.register_uri(...), which ensures that we get a fresh
callback with the expected version of the metadata.
LP: #1658200
Diffstat (limited to 'tests/unittests')
-rw-r--r-- | tests/unittests/test_datasource/test_gce.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/unittests/test_datasource/test_gce.py b/tests/unittests/test_datasource/test_gce.py index 4f667678..a5cced07 100644 --- a/tests/unittests/test_datasource/test_gce.py +++ b/tests/unittests/test_datasource/test_gce.py @@ -59,6 +59,8 @@ def _set_mock_metadata(gce_meta=None): else: return (404, headers, '') + # reset is needed. https://github.com/gabrielfalcao/HTTPretty/issues/316 + httpretty.reset() httpretty.register_uri(httpretty.GET, MD_URL_RE, body=_request_callback) |