Skip to content

Commit 5aee15e

Browse files
authored
Merge pull request #3 from erick-sapp/master
Realignment
2 parents 5320df0 + 0b83362 commit 5aee15e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

SoftLayer/shell/cmd_help.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def cli(ctx, env):
2222
shell_commands = []
2323
for name in cli_core.cli.list_commands(ctx):
2424
command = cli_core.cli.get_command(ctx, name)
25+
if command.short_help is None:
26+
command.short_help = command.help
2527
details = (name, command.short_help)
2628
if name in dict(routes.ALL_ROUTES):
2729
shell_commands.append(details)

tests/CLI/modules/shell_tests.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,13 @@ def test_shell_quit(self, prompt):
1515
prompt.return_value = "quit"
1616
result = self.run_command(['shell'])
1717
self.assertEqual(result.exit_code, 0)
18+
19+
@mock.patch('prompt_toolkit.shortcuts.prompt')
20+
@mock.patch('shlex.split')
21+
def test_shell_help(self, prompt, split):
22+
split.side_effect = [(['help']), (['vs', 'list']), (False), (['quit'])]
23+
prompt.return_value = "none"
24+
result = self.run_command(['shell'])
25+
if split.call_count is not 5:
26+
raise Exception("Split not called correctly. Count: " + str(split.call_count))
27+
self.assertEqual(result.exit_code, 1)

0 commit comments

Comments
 (0)