diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-09-17 22:12:41 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-09-17 22:12:41 -0400 |
commit | efadff391032482b139524c96dfc4130fc631f9c (patch) | |
tree | 1f5a35d1c65a8c68f8a5eaa4bd78c3cf5d487fa5 /tests/test_completion.py | |
parent | 74857c34c00323c881f1669ae95788dcff6a48fa (diff) | |
parent | 1176c0cc99975044d2fcec88b3f0903b8453194f (diff) | |
download | cmd2-git-efadff391032482b139524c96dfc4130fc631f9c.tar.gz |
Merge branch 'master' into doc_additions
Diffstat (limited to 'tests/test_completion.py')
-rwxr-xr-x | tests/test_completion.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/tests/test_completion.py b/tests/test_completion.py index cf5dcf75..c7d9bd21 100755 --- a/tests/test_completion.py +++ b/tests/test_completion.py @@ -1179,22 +1179,14 @@ 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 +def test_complete_help_subcommands_with_blank_command(scu_app): text = '' - line = 'help ' + line = 'help "" {}'.format(text) 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) + first_match = complete_tester(text, line, begidx, endidx, scu_app) + assert first_match is None and not scu_app.completion_matches def test_cmd2_help_subcommand_completion_nomatch_scu(scu_app): |