diff options
| author | Jenkins <jenkins@review.openstack.org> | 2017-02-27 03:47:11 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2017-02-27 03:47:11 +0000 |
| commit | e5ee4b8ca3a1de9208ea0e05efec4162c4b9d6a4 (patch) | |
| tree | 671e41ceb54d251fc731a2c00d9b4b6a338c404e /openstackclient/tests/unit | |
| parent | f63a9f402dc3761a1f7e358d92b7e1aa33098c7a (diff) | |
| parent | 0898ebacb8d9c38ae36adaf593867a9b16a50504 (diff) | |
| download | python-openstackclient-e5ee4b8ca3a1de9208ea0e05efec4162c4b9d6a4.tar.gz | |
Merge "Support list commands by group name keyword"
Diffstat (limited to 'openstackclient/tests/unit')
| -rw-r--r-- | openstackclient/tests/unit/common/test_module.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/common/test_module.py b/openstackclient/tests/unit/common/test_module.py index 4b586d3b..2491d639 100644 --- a/openstackclient/tests/unit/common/test_module.py +++ b/openstackclient/tests/unit/common/test_module.py @@ -88,6 +88,41 @@ class TestCommandList(utils.TestCommand): self.assertEqual(datalist, tuple(data)) + def test_command_list_with_group_not_found(self): + arglist = [ + '--group', 'not_exist', + ] + verifylist = [ + ('group', 'not_exist'), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + columns, data = self.cmd.take_action(parsed_args) + + collist = ('Command Group', 'Commands') + self.assertEqual(collist, columns) + self.assertEqual([], data) + + def test_command_list_with_group(self): + arglist = [ + '--group', 'common', + ] + verifylist = [ + ('group', 'common'), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + columns, data = self.cmd.take_action(parsed_args) + + collist = ('Command Group', 'Commands') + self.assertEqual(collist, columns) + datalist = (( + 'openstack.common', + 'limits show\nextension list' + ),) + + self.assertEqual(datalist, tuple(data)) + @mock.patch.dict( 'openstackclient.common.module.sys.modules', |
