summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional/common
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/tests/functional/common')
-rw-r--r--openstackclient/tests/functional/common/test_extension.py1
-rw-r--r--openstackclient/tests/functional/common/test_help.py14
-rw-r--r--openstackclient/tests/functional/common/test_quota.py1
3 files changed, 9 insertions, 7 deletions
diff --git a/openstackclient/tests/functional/common/test_extension.py b/openstackclient/tests/functional/common/test_extension.py
index d7dc398b..e3a91fe6 100644
--- a/openstackclient/tests/functional/common/test_extension.py
+++ b/openstackclient/tests/functional/common/test_extension.py
@@ -25,6 +25,7 @@ class ExtensionTests(base.TestCase):
@classmethod
def setUpClass(cls):
+ super(ExtensionTests, cls).setUpClass()
cls.haz_network = base.is_service_enabled('network')
def test_extension_list_compute(self):
diff --git a/openstackclient/tests/functional/common/test_help.py b/openstackclient/tests/functional/common/test_help.py
index e31d3b86..7f274099 100644
--- a/openstackclient/tests/functional/common/test_help.py
+++ b/openstackclient/tests/functional/common/test_help.py
@@ -12,6 +12,8 @@
import os
+import fixtures
+
from openstackclient.tests.functional import base
@@ -76,10 +78,11 @@ class HelpTests(base.TestCase):
def test_commands_help_no_auth(self):
"""Check help commands without auth info."""
- # Pop all auth info
- auth_info = {key: os.environ.pop(key)
- for key in os.environ.keys()
- if key.startswith('OS_')}
+ # Pop all auth info. os.environ will be changed in loop, so do not
+ # replace os.environ.keys() to os.environ
+ for key in os.environ.keys():
+ if key.startswith('OS_'):
+ self.useFixture(fixtures.EnvironmentVariable(key, None))
raw_output = self.openstack('help')
self.assertIn('usage: openstack', raw_output)
@@ -115,6 +118,3 @@ class HelpTests(base.TestCase):
self.assertIn('List containers', raw_output)
raw_output = self.openstack('container list --help')
self.assertIn('List containers', raw_output)
-
- # Restore auth info
- os.environ.update(auth_info)
diff --git a/openstackclient/tests/functional/common/test_quota.py b/openstackclient/tests/functional/common/test_quota.py
index 1b13e95e..76c69a4d 100644
--- a/openstackclient/tests/functional/common/test_quota.py
+++ b/openstackclient/tests/functional/common/test_quota.py
@@ -26,6 +26,7 @@ class QuotaTests(base.TestCase):
@classmethod
def setUpClass(cls):
+ super(QuotaTests, cls).setUpClass()
cls.haz_network = base.is_service_enabled('network')
cls.PROJECT_NAME =\
cls.get_openstack_configuration_value('auth.project_name')