summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-08-31 01:55:48 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-08-31 02:16:25 -0400
commit7706e16ed2a52829e5e95e1a6b68eee86b7a5eb4 (patch)
tree5e5d67cd317f9d71c5d8fbc5c502a4e66c65b42d /tests
parentdf703af969219665b7d672025bf9b26f75a76285 (diff)
downloadcmd2-git-7706e16ed2a52829e5e95e1a6b68eee86b7a5eb4.tar.gz
Refactored complete() to handle custom behavior from read_input()
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_cmd2.py8
-rwxr-xr-xtests/test_completion.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 3b240e4e..be6f52d1 100755
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -2247,7 +2247,7 @@ def test_disable_and_enable_category(disable_commands_app):
# Make sure neither function completes
text = ''
- line = 'has_helper_funcs'
+ line = 'has_helper_funcs {}'.format(text)
endidx = len(line)
begidx = endidx - len(text)
@@ -2255,7 +2255,7 @@ def test_disable_and_enable_category(disable_commands_app):
assert first_match is None
text = ''
- line = 'has_no_helper_funcs'
+ line = 'has_no_helper_funcs {}'.format(text)
endidx = len(line)
begidx = endidx - len(text)
@@ -2291,7 +2291,7 @@ def test_disable_and_enable_category(disable_commands_app):
# has_helper_funcs should complete now
text = ''
- line = 'has_helper_funcs'
+ line = 'has_helper_funcs {}'.format(text)
endidx = len(line)
begidx = endidx - len(text)
@@ -2300,7 +2300,7 @@ def test_disable_and_enable_category(disable_commands_app):
# has_no_helper_funcs had no completer originally, so there should be no results
text = ''
- line = 'has_no_helper_funcs'
+ line = 'has_no_helper_funcs {}'.format(text)
endidx = len(line)
begidx = endidx - len(text)
diff --git a/tests/test_completion.py b/tests/test_completion.py
index ac4216bb..d0771795 100755
--- a/tests/test_completion.py
+++ b/tests/test_completion.py
@@ -858,9 +858,9 @@ def test_no_completer(cmd2_app):
first_match = complete_tester(text, line, begidx, endidx, cmd2_app)
assert first_match is not None and cmd2_app.completion_matches == expected
-def test_quote_as_command(cmd2_app):
+def test_wordbreak_in_command(cmd2_app):
text = ''
- line = '" {}'.format(text)
+ line = '"{}'.format(text)
endidx = len(line)
begidx = endidx - len(text)