Skip to content

Commit 3258664

Browse files
author
zhiyong.dai
committed
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
1 parent 46d1df0 commit 3258664

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

openstackclient/tests/functional/common/test_module.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ class ModuleTest(base.TestCase):
2929
'os_client_config',
3030
'keystoneauth1']
3131

32-
def test_module_list_no_options(self):
33-
json_output = json.loads(self.openstack('module list -f json'))
32+
def test_module_list(self):
33+
# Test module list
34+
cmd_output = json.loads(self.openstack('module list -f json'))
3435
for one_module in self.CLIENTS:
35-
self.assertIn(one_module, json_output.keys())
36-
37-
def test_module_list_with_all_option(self):
38-
json_output = json.loads(self.openstack('module list --all -f json'))
39-
for one_module in (self.CLIENTS + self.LIBS):
40-
self.assertIn(one_module, json_output.keys())
36+
self.assertIn(one_module, cmd_output.keys())
37+
for one_module in self.LIBS:
38+
self.assertNotIn(one_module, cmd_output.keys())
39+
40+
# Test module list --all
41+
cmd_output = json.loads(self.openstack('module list --all -f json'))
42+
for one_module in self.CLIENTS + self.LIBS:
43+
self.assertIn(one_module, cmd_output.keys())

0 commit comments

Comments
 (0)