diff options
author | Scott Moser <smoser@ubuntu.com> | 2014-07-24 08:49:42 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-07-24 08:49:42 -0400 |
commit | 84ee0821f32c652fd377663c2e73658437ae99ab (patch) | |
tree | cbebe02dbaa15307c9992d068a714613be2fdce1 /tests/unittests/helpers.py | |
parent | a000671207ee4a445261b05d22c2f3357b413053 (diff) | |
parent | 27ce1e10692e93cfb9b87df547de4e0930ec4d28 (diff) | |
download | vyos-cloud-init-84ee0821f32c652fd377663c2e73658437ae99ab.tar.gz vyos-cloud-init-84ee0821f32c652fd377663c2e73658437ae99ab.zip |
merge from trunk
Diffstat (limited to 'tests/unittests/helpers.py')
-rw-r--r-- | tests/unittests/helpers.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unittests/helpers.py b/tests/unittests/helpers.py index 970eb8cb..9700a4ca 100644 --- a/tests/unittests/helpers.py +++ b/tests/unittests/helpers.py @@ -233,6 +233,21 @@ class FilesystemMockingTestCase(ResourceUsingTestCase): self.patched_funcs.append((mod, f, func)) +class HttprettyTestCase(TestCase): + # necessary as http_proxy gets in the way of httpretty + # https://github.com/gabrielfalcao/HTTPretty/issues/122 + def setUp(self): + self.restore_proxy = os.environ.get('http_proxy') + if self.restore_proxy is not None: + del os.environ['http_proxy'] + super(HttprettyTestCase, self).setUp() + + def tearDown(self): + if self.restore_proxy: + os.environ['http_proxy'] = self.restore_proxy + super(HttprettyTestCase, self).tearDown() + + def populate_dir(path, files): if not os.path.exists(path): os.makedirs(path) |