diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-12-13 23:00:01 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-12-13 23:00:01 +0000 |
commit | 39a0eda48666e88fea3ba2109773dbadaa2d5474 (patch) | |
tree | 69695727cfdcdd65088cd185f28c3a2b37d3c761 /tests | |
parent | e3d6c34c982091882a5578ab2bdaf6da00eae4d6 (diff) | |
parent | 41666d60c88e4b70bceb7898459a93e6cf389382 (diff) | |
download | python-swiftclient-39a0eda48666e88fea3ba2109773dbadaa2d5474.tar.gz |
Merge "modify 'swift <sub_command> —help' display"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/test_shell.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/unit/test_shell.py b/tests/unit/test_shell.py index 9408e73..00677df 100644 --- a/tests/unit/test_shell.py +++ b/tests/unit/test_shell.py @@ -1688,18 +1688,21 @@ class TestSubcommandHelp(unittest.TestCase): def test_subcommand_help(self): for command in swiftclient.shell.commands: help_var = 'st_%s_help' % command + options_var = 'st_%s_options' % command self.assertTrue(hasattr(swiftclient.shell, help_var)) with CaptureOutput() as out: argv = ['', command, '--help'] self.assertRaises(SystemExit, swiftclient.shell.main, argv) - expected = vars(swiftclient.shell)[help_var] + expected = 'Usage: swift %s %s\n%s' % ( + command, vars(swiftclient.shell).get(options_var, "\n"), + vars(swiftclient.shell)[help_var]) self.assertEqual(out.strip('\n'), expected) def test_no_help(self): with CaptureOutput() as out: argv = ['', 'bad_command', '--help'] self.assertRaises(SystemExit, swiftclient.shell.main, argv) - expected = 'no help for bad_command' + expected = 'no such command: bad_command' self.assertEqual(out.strip('\n'), expected) |