Isolate test from environment variables
One test ('test_get_client_all_creds') will fail if any of the typical Openstack environment variables have been set (eg OS_PASSWORD). Change-Id: I982f526168be7a5a07b5cd48af522f7f9bc74f2e Closes-bug: #1376247
This commit is contained in:
parent
2365a3fb5f
commit
60359e9b36
|
@ -78,13 +78,19 @@ class GetClientTestCase(utils.BaseTestCase):
|
|||
def setUp(self):
|
||||
super(GetClientTestCase, self).setUp()
|
||||
self.host = 'test_host'
|
||||
self.env = os.environ.copy()
|
||||
os.environ.clear()
|
||||
|
||||
def tearDown(self):
|
||||
os.environ = self.env
|
||||
super(GetClientTestCase, self).tearDown()
|
||||
|
||||
def test_get_client_host_only(self):
|
||||
expected_creds = {
|
||||
'username': None,
|
||||
'password': None,
|
||||
'tenant': None,
|
||||
'auth_url': os.getenv('OS_AUTH_URL'),
|
||||
'auth_url': None,
|
||||
'strategy': 'noauth',
|
||||
'region': None
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue