diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-07-08 12:34:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-08 12:34:24 -0400 |
commit | a140ad1cdb531d2bc60237502cf8601f46d60692 (patch) | |
tree | 0a81b43613d77548f792721773d707a52f4fb282 /tests/test_cmd2.py | |
parent | 22c43d7226b93b8d01ebb07de3fd41fda63f9005 (diff) | |
parent | af248f98c8a6c35c0ea68d59057830de25cd3f9b (diff) | |
download | cmd2-git-a140ad1cdb531d2bc60237502cf8601f46d60692.tar.gz |
Merge pull request #178 from python-cmd2/remove_filehack
Remove ugly file hack code which is no longer necessary
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r-- | tests/test_cmd2.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 8bb1f52a..7e393b7b 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -1262,3 +1262,23 @@ def test_eos(base_app): # And make sure it reduced the length of the script dir list assert len(base_app._script_dir) == 0 + + +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'] + app._script_dir.append('some_dir') + + assert app._current_script_dir is not None + + # Run the inner _cmdloop + app._cmdloop() + + out, err = capsys.readouterr() + + # 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') |