diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-08-02 01:46:58 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-08-02 01:46:58 -0400 |
commit | a1ce5070ed97e90c5946b82496d33952ab3b821c (patch) | |
tree | f0916bccbcca134c1aa1b75b0db135f722d0d259 /tests/test_completion.py | |
parent | 65875bdfc434474ecd2c019ef77fa99d3da8faf9 (diff) | |
download | cmd2-git-a1ce5070ed97e90c5946b82496d33952ab3b821c.tar.gz |
Fixed inconsistent parsing/tab completion behavior based on the value of `allow_redirection`. This flag is
only meant to be a security setting that prevents redirection of stdout and should not alter parsing logic.
Diffstat (limited to 'tests/test_completion.py')
-rwxr-xr-x[-rw-r--r--] | tests/test_completion.py | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/tests/test_completion.py b/tests/test_completion.py index 59fe04d1..dcca1c7d 100644..100755 --- a/tests/test_completion.py +++ b/tests/test_completion.py @@ -695,7 +695,6 @@ def test_tokens_for_completion_redirect(cmd2_app): endidx = len(line) begidx = endidx - len(text) - cmd2_app.allow_redirection = True expected_tokens = ['command', '|', '<', '>>', 'file'] expected_raw_tokens = ['command', '|', '<', '>>', 'file'] @@ -717,20 +716,6 @@ def test_tokens_for_completion_quoted_redirect(cmd2_app): assert expected_tokens == tokens assert expected_raw_tokens == raw_tokens -def test_tokens_for_completion_redirect_off(cmd2_app): - text = '>file' - line = 'command {}'.format(text) - endidx = len(line) - begidx = endidx - len(text) - - cmd2_app.statement_parser.allow_redirection = False - expected_tokens = ['command', '>file'] - expected_raw_tokens = ['command', '>file'] - - tokens, raw_tokens = cmd2_app.tokens_for_completion(line, begidx, endidx) - assert expected_tokens == tokens - assert expected_raw_tokens == raw_tokens - def test_add_opening_quote_basic_no_text(cmd2_app): text = '' line = 'test_basic {}'.format(text) |