diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-09-16 19:33:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-16 19:33:11 -0400 |
commit | 60ab11c3166a2a76bf67774c67b583d7d30fe5be (patch) | |
tree | 89bea336649b0e270b62c43ac501b1339992b967 /tests/test_completion.py | |
parent | f10674e6db245da5b4062aef3391d54c33277255 (diff) | |
parent | c7bf16f3ab46d5b6f4c48c038b620930fbe4551b (diff) | |
download | cmd2-git-60ab11c3166a2a76bf67774c67b583d7d30fe5be.tar.gz |
Merge pull request #774 from python-cmd2/completion_state
Completion state
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..fb0d74e0 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_subcommand_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): |