diff options
| author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-06-15 22:37:04 -0400 |
|---|---|---|
| committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-06-15 22:37:04 -0400 |
| commit | 59df11763b2411a803434debf13949dbbe23c020 (patch) | |
| tree | 9552d35b6284656e46f044070ca946e3f3ed358a /tests/test_completion.py | |
| parent | 5950946c258ac692a7dd72d1ee22660a899880ce (diff) | |
| download | cmd2-git-59df11763b2411a803434debf13949dbbe23c020.tar.gz | |
Trying to fix shell command completion unit tests on Windows.
pyreadline won't engage the completer when just "!calc" is typed, need "! calc" or "shell calc". Basically it needs a space after to recognize it as a command and route it to the correct completer method.
Diffstat (limited to 'tests/test_completion.py')
| -rw-r--r-- | tests/test_completion.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/test_completion.py b/tests/test_completion.py index e72260d7..98f4387a 100644 --- a/tests/test_completion.py +++ b/tests/test_completion.py @@ -68,11 +68,11 @@ def test_cmd2_help_completion_multiple(cmd2_app): def test_shell_command_completion(cmd2_app): if sys.platform == "win32": - text = 'di' - line = '!di' - begidx = 1 - endidx = 3 - assert cmd2_app.complete_shell(text, line, begidx, endidx) == ['dir '] + text = 'calc' + line = 'shell calc' + begidx = 6 + endidx = 10 + assert cmd2_app.complete_shell(text, line, begidx, endidx) == ['calc.exe '] else: text = 'eg' line = '!eg' @@ -82,11 +82,11 @@ def test_shell_command_completion(cmd2_app): def test_shell_command_completion_multiple(cmd2_app): if sys.platform == "win32": - text = 'd' - line = '!d' - begidx = 1 - endidx = 2 - assert 'dir' in cmd2_app.complete_shell(text, line, begidx, endidx) + text = 'c' + line = 'shell c' + begidx = 6 + endidx = 7 + assert 'calc.exe' in cmd2_app.complete_shell(text, line, begidx, endidx) else: text = 'l' line = '!l' |
