summaryrefslogtreecommitdiff
path: root/tests/test_completion.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-09-16 19:33:11 -0400
committerGitHub <noreply@github.com>2019-09-16 19:33:11 -0400
commit60ab11c3166a2a76bf67774c67b583d7d30fe5be (patch)
tree89bea336649b0e270b62c43ac501b1339992b967 /tests/test_completion.py
parentf10674e6db245da5b4062aef3391d54c33277255 (diff)
parentc7bf16f3ab46d5b6f4c48c038b620930fbe4551b (diff)
downloadcmd2-git-60ab11c3166a2a76bf67774c67b583d7d30fe5be.tar.gz
Merge pull request #774 from python-cmd2/completion_state
Completion state
Diffstat (limited to 'tests/test_completion.py')
-rwxr-xr-xtests/test_completion.py16
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):