diff --git a/SoftLayer/CLI/virt/placementgroup/__init__.py b/SoftLayer/CLI/virt/placementgroup/__init__.py index 02d5da986..aa748a5b1 100644 --- a/SoftLayer/CLI/virt/placementgroup/__init__.py +++ b/SoftLayer/CLI/virt/placementgroup/__init__.py @@ -44,4 +44,3 @@ def get_command(self, ctx, cmd_name): @click.group(cls=PlacementGroupCommands, context_settings=CONTEXT) def cli(): """Base command for all capacity related concerns""" - pass diff --git a/SoftLayer/shell/cmd_help.py b/SoftLayer/shell/cmd_help.py index eeceef068..2f548d75d 100644 --- a/SoftLayer/shell/cmd_help.py +++ b/SoftLayer/shell/cmd_help.py @@ -22,6 +22,8 @@ def cli(ctx, env): shell_commands = [] for name in cli_core.cli.list_commands(ctx): command = cli_core.cli.get_command(ctx, name) + if command.short_help is None: + command.short_help = command.help details = (name, command.short_help) if name in dict(routes.ALL_ROUTES): shell_commands.append(details) diff --git a/tests/CLI/modules/shell_tests.py b/tests/CLI/modules/shell_tests.py index 5f4b82c03..bf71d7004 100644 --- a/tests/CLI/modules/shell_tests.py +++ b/tests/CLI/modules/shell_tests.py @@ -15,3 +15,13 @@ def test_shell_quit(self, prompt): prompt.return_value = "quit" result = self.run_command(['shell']) self.assertEqual(result.exit_code, 0) + + @mock.patch('prompt_toolkit.shortcuts.prompt') + @mock.patch('shlex.split') + def test_shell_help(self, prompt, split): + split.side_effect = [(['help']), (['vs', 'list']), (False), (['quit'])] + prompt.return_value = "none" + result = self.run_command(['shell']) + if split.call_count is not 5: + raise Exception("Split not called correctly. Count: " + str(split.call_count)) + self.assertEqual(result.exit_code, 1)