diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_completion.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_completion.py b/tests/test_completion.py index e26b8a2f..1b7b65d2 100644 --- a/tests/test_completion.py +++ b/tests/test_completion.py @@ -948,6 +948,23 @@ def test_cmd2_help_subcommand_completion_with_flags_before_command(scu_app): first_match = complete_tester(text, line, begidx, endidx, scu_app) assert first_match is not None and scu_app.completion_matches == ['bar', 'foo', 'sport'] +def test_complete_help_subcommand_with_no_command(scu_app): + # No command because not enough tokens + text = '' + line = 'help ' + endidx = len(line) + begidx = endidx - len(text) + + assert not scu_app.complete_help_subcommand(text, line, begidx, endidx) + + # No command because everything is a flag + text = '-v' + line = 'help -f -v' + endidx = len(line) + begidx = endidx - len(text) + + assert not scu_app.complete_help_subcommand(text, line, begidx, endidx) + def test_cmd2_help_subcommand_completion_nomatch_scu(scu_app): text = 'z' |