summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_cmd2.py9
-rw-r--r--tests/test_completion.py4
-rw-r--r--tests/test_transcript.py3
3 files changed, 7 insertions, 9 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 6733be19..2137b564 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -105,7 +105,7 @@ def test_base_show_readonly(base_app):
Commands may be terminated with: {}
Arguments at invocation allowed: {}
Output redirection and pipes allowed: {}
-""".format(base_app.terminators, base_app.allow_cli_args, base_app.allow_redirection))
+""".format(base_app.statement_parser.terminators, base_app.allow_cli_args, base_app.allow_redirection))
assert out == expected
@@ -558,9 +558,9 @@ def test_feedback_to_output_false(base_app, capsys):
os.remove(filename)
-def test_allow_redirection(base_app):
+def test_disallow_redirection(base_app):
# Set allow_redirection to False
- base_app.allow_redirection = False
+ base_app.statement_parser.allow_redirection = False
filename = 'test_allow_redirect.txt'
@@ -1265,8 +1265,7 @@ def test_which_editor_bad():
class MultilineApp(cmd2.Cmd):
def __init__(self, *args, **kwargs):
- self.multiline_commands = ['orate']
- super().__init__(*args, **kwargs)
+ super().__init__(*args, multiline_commands=['orate'], **kwargs)
orate_parser = argparse.ArgumentParser()
orate_parser.add_argument('-s', '--shout', action="store_true", help="N00B EMULATION MODE")
diff --git a/tests/test_completion.py b/tests/test_completion.py
index da7fae65..47a7a9d6 100644
--- a/tests/test_completion.py
+++ b/tests/test_completion.py
@@ -649,7 +649,7 @@ def test_tokens_for_completion_quoted_redirect(cmd2_app):
endidx = len(line)
begidx = endidx - len(text)
- cmd2_app.allow_redirection = True
+ cmd2_app.statement_parser.redirection = True
expected_tokens = ['command', '>file']
expected_raw_tokens = ['command', '">file']
@@ -663,7 +663,7 @@ def test_tokens_for_completion_redirect_off(cmd2_app):
endidx = len(line)
begidx = endidx - len(text)
- cmd2_app.allow_redirection = False
+ cmd2_app.statement_parser.allow_redirection = False
expected_tokens = ['command', '>file']
expected_raw_tokens = ['command', '>file']
diff --git a/tests/test_transcript.py b/tests/test_transcript.py
index f93642b8..4a03ebe0 100644
--- a/tests/test_transcript.py
+++ b/tests/test_transcript.py
@@ -29,10 +29,9 @@ class CmdLineApp(cmd2.Cmd):
MUMBLE_LAST = ['right?']
def __init__(self, *args, **kwargs):
- self.multiline_commands = ['orate']
self.maxrepeats = 3
- super().__init__(*args, **kwargs)
+ super().__init__(*args, multiline_commands=['orate'], **kwargs)
# Make maxrepeats settable at runtime
self.settable['maxrepeats'] = 'Max number of `--repeat`s allowed'