summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional
diff options
context:
space:
mode:
authorzhiyong.dai <zhiyong.dai@easystack.cn>2016-11-27 21:07:34 +0800
committerzhiyong.dai <zhiyong.dai@easystack.cn>2016-11-27 21:07:34 +0800
commit3258664c7a2ab7a4fda3ed5e46ec4768ca6c56e8 (patch)
tree33982d3448da31625d8d0a3820625c5aa238e82b /openstackclient/tests/functional
parent46d1df0adf00862a4b9ff21925836539a0e2f98f (diff)
downloadpython-openstackclient-3258664c7a2ab7a4fda3ed5e46ec4768ca6c56e8.tar.gz
Refactor module functional test
Combine "test_module_list_no_options" and "test_module_list_with_all_option" into one test, and modify the test for "--all' option. Change-Id: If4e7a73502a888c50de17ec19ef7e8d02dd23f1d
Diffstat (limited to 'openstackclient/tests/functional')
-rw-r--r--openstackclient/tests/functional/common/test_module.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/openstackclient/tests/functional/common/test_module.py b/openstackclient/tests/functional/common/test_module.py
index f56c1627..b56c83ad 100644
--- a/openstackclient/tests/functional/common/test_module.py
+++ b/openstackclient/tests/functional/common/test_module.py
@@ -29,12 +29,15 @@ class ModuleTest(base.TestCase):
'os_client_config',
'keystoneauth1']
- def test_module_list_no_options(self):
- json_output = json.loads(self.openstack('module list -f json'))
+ def test_module_list(self):
+ # Test module list
+ cmd_output = json.loads(self.openstack('module list -f json'))
for one_module in self.CLIENTS:
- self.assertIn(one_module, json_output.keys())
-
- def test_module_list_with_all_option(self):
- json_output = json.loads(self.openstack('module list --all -f json'))
- for one_module in (self.CLIENTS + self.LIBS):
- self.assertIn(one_module, json_output.keys())
+ self.assertIn(one_module, cmd_output.keys())
+ for one_module in self.LIBS:
+ self.assertNotIn(one_module, cmd_output.keys())
+
+ # Test module list --all
+ cmd_output = json.loads(self.openstack('module list --all -f json'))
+ for one_module in self.CLIENTS + self.LIBS:
+ self.assertIn(one_module, cmd_output.keys())