From ba1319f22f9e116a12d525d8d1d50cfe6318db4c Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Wed, 23 Aug 2017 08:28:19 -0400 Subject: Improved what gets printed when running commands from a script with load command and echo is True Previously just the command get printed. Now the prompt and the command gets printed. --- tests/test_cmd2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 51421bcb..dcbb99f7 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -1372,7 +1372,8 @@ def test_echo(capsys): app = cmd2.Cmd() # Turn echo on and pre-stage some commands in the queue, simulating like we are in the middle of a script app.echo = True - app.cmdqueue = ['help history', 'quit', 'eos'] + command = 'help history' + app.cmdqueue = [command, 'quit', 'eos'] app._script_dir.append('some_dir') assert app._current_script_dir is not None @@ -1385,7 +1386,7 @@ def test_echo(capsys): # Check the output assert app.cmdqueue == [] assert app._current_script_dir is None - assert out.startswith('help history\n' + 'history [arg]: lists past commands issued') + assert out.startswith('{}{}\n'.format(app.prompt, command) + 'history [arg]: lists past commands issued') def test_raw_input(base_app): -- cgit v1.2.1