Merge "Refactor module functional test"

This commit is contained in:
Jenkins 2017-02-13 17:27:39 +00:00 committed by Gerrit Code Review
commit 0c42c88d88

View File

@ -29,12 +29,15 @@ class ModuleTest(base.TestCase):
'os_client_config', 'os_client_config',
'keystoneauth1'] 'keystoneauth1']
def test_module_list_no_options(self): def test_module_list(self):
json_output = json.loads(self.openstack('module list -f json')) # Test module list
cmd_output = json.loads(self.openstack('module list -f json'))
for one_module in self.CLIENTS: for one_module in self.CLIENTS:
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())
def test_module_list_with_all_option(self): # Test module list --all
json_output = json.loads(self.openstack('module list --all -f json')) cmd_output = json.loads(self.openstack('module list --all -f json'))
for one_module in (self.CLIENTS + self.LIBS): for one_module in self.CLIENTS + self.LIBS:
self.assertIn(one_module, json_output.keys()) self.assertIn(one_module, cmd_output.keys())