From f746e172f4a0ba1dfa381f1abafbde2cca61cc3b Mon Sep 17 00:00:00 2001 From: Naohiro Tamura Date: Tue, 16 Dec 2014 23:12:41 +0900 Subject: [PATCH] Removed http proxy environment variable so that httpretty can work If test environment is located behind a http proxy, tox and pip require to set http proxy environment variable. However httpretty mock library does NOT work as expected if http proxy is set. Therefor code to remove the http proxy environment variable is added into the fixture. Change-Id: Ibd3bb833774b1362e628725603b9b274b09375bd Closes-Bug: #1403046 --- ironicclient/tests/test_shell.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ironicclient/tests/test_shell.py b/ironicclient/tests/test_shell.py index bea3a7ac9..cc7e86091 100644 --- a/ironicclient/tests/test_shell.py +++ b/ironicclient/tests/test_shell.py @@ -13,6 +13,7 @@ # under the License. import json +import os import re import sys @@ -226,6 +227,10 @@ class TestCase(testtools.TestCase): class ShellTestNoMox(TestCase): def setUp(self): super(ShellTestNoMox, self).setUp() + # httpretty doesn't work as expected if http proxy environment + # variable is set. + os.environ = dict((k, v) for (k, v) in os.environ.items() + if k.lower() not in ('http_proxy', 'https_proxy')) self.set_fake_env(FAKE_ENV_KEYSTONE_V2) def shell(self, argstr):