From a1ce5070ed97e90c5946b82496d33952ab3b821c Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Fri, 2 Aug 2019 01:46:58 -0400 Subject: 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. --- tests/test_completion.py | 15 --------------- 1 file changed, 15 deletions(-) mode change 100644 => 100755 tests/test_completion.py (limited to 'tests/test_completion.py') diff --git a/tests/test_completion.py b/tests/test_completion.py old mode 100644 new mode 100755 index 59fe04d1..dcca1c7d --- 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) -- cgit v1.2.1