summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-08-09 15:43:49 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2017-08-09 15:43:49 -0400
commitc28a027ae9c085603590f75aff3b34368a6b7265 (patch)
tree7e202a2bd1f629f3d8311ffd633b521ecbe7260d /tests/test_cmd2.py
parentbe2c87e77765dc0bbee3ba0cc7a8beedb6d37545 (diff)
downloadcmd2-git-c28a027ae9c085603590f75aff3b34368a6b7265.tar.gz
Made a few code ruggedizations
- poutput() can now take any argument convertible to a str via '{}'.format() instead of only str - postparsing_postcmd() automatically runs a 'stty sane' on POSIX OSes to handle those cases of your terminal getting in a messed up state if you do something like pipe to a terminal command like "less" and then improperly quit out of it with a <Ctrl>-C instead of properly using "q" - In _restore_output(), immeditelly restore stdout state in a finally block after closing the temporary one used for redirection/piping
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 77ee6e6c..15b5326c 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -856,7 +856,7 @@ def test_default_to_shell_good(capsys):
app.default_to_shell = True
line = 'ls'
statement = app.parser_manager.parsed(line)
- retval = app._default(statement)
+ retval = app.default(statement)
assert not retval
out, err = capsys.readouterr()
assert out == ''
@@ -866,7 +866,7 @@ def test_default_to_shell_failure(capsys):
app.default_to_shell = True
line = 'ls does_not_exist.xyz'
statement = app.parser_manager.parsed(line)
- retval = app._default(statement)
+ retval = app.default(statement)
assert not retval
out, err = capsys.readouterr()
assert out == "*** Unknown syntax: {}\n".format(line)