From 0419f2584d2c162746549daf29f0b1677dd4d8d1 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Tue, 10 Jul 2018 23:06:22 -0400 Subject: Added a couple simple unit tests for the case where onecmd accepts a raw string --- tests/test_cmd2.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/test_cmd2.py') 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 == '' + -- cgit v1.2.1