Skip to content

Commit 0419f25

Browse files
committed
Added a couple simple unit tests for the case where onecmd accepts a raw string
1 parent 6c90d3c commit 0419f25

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_cmd2.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,3 +1787,18 @@ def test_readline_remove_history_item(base_app):
17871787
assert readline.get_current_history_length() == 1
17881788
readline.remove_history_item(0)
17891789
assert readline.get_current_history_length() == 0
1790+
1791+
def test_onecmd_raw_str_continue(base_app):
1792+
line = "help"
1793+
stop = base_app.onecmd(line)
1794+
out = base_app.stdout.buffer
1795+
assert not stop
1796+
assert out.strip() == BASE_HELP.strip()
1797+
1798+
def test_onecmd_raw_str_quit(base_app):
1799+
line = "quit"
1800+
stop = base_app.onecmd(line)
1801+
out = base_app.stdout.buffer
1802+
assert stop
1803+
assert out == ''
1804+

0 commit comments

Comments
 (0)