summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-07-11 09:32:02 -0400
committerGitHub <noreply@github.com>2018-07-11 09:32:02 -0400
commite10afbeb6efe7dd806b04bd53eca615bca5d5ffc (patch)
tree29c11f4ce7032f06f5ee54452c42b24799870eaf /tests/test_cmd2.py
parent6ddb6842e5ac87fb5c433eb8d86df48f3e045da2 (diff)
parent4f90260edb21d6134338e43f5465b54b261db2c5 (diff)
downloadcmd2-git-e10afbeb6efe7dd806b04bd53eca615bca5d5ffc.tar.gz
Merge pull request #465 from python-cmd2/onecmd_str
Allow onecmd to accept a raw string for backward compatibility with cmd
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 77dcc875..b973fdf5 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -1787,3 +1787,18 @@ def test_readline_remove_history_item(base_app):
assert readline.get_current_history_length() == 1
readline.remove_history_item(0)
assert readline.get_current_history_length() == 0
+
+def test_onecmd_raw_str_continue(base_app):
+ line = "help"
+ stop = base_app.onecmd(line)
+ out = base_app.stdout.buffer
+ assert not stop
+ assert out.strip() == BASE_HELP.strip()
+
+def test_onecmd_raw_str_quit(base_app):
+ line = "quit"
+ stop = base_app.onecmd(line)
+ out = base_app.stdout.buffer
+ assert stop
+ assert out == ''
+