Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion SoftLayer/CLI/virt/placementgroup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions SoftLayer/shell/cmd_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions tests/CLI/modules/shell_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)