diff options
author | Eric Lin <anselor@gmail.com> | 2020-08-27 17:07:43 -0400 |
---|---|---|
committer | anselor <anselor@gmail.com> | 2020-08-27 18:21:18 -0400 |
commit | 47f8652fa467b2d140b1097b3167f968b0188451 (patch) | |
tree | 81fe0931f4715463d87a06752f947bef771c00d0 /tests/test_cmd2.py | |
parent | e3a07c59b541b4a0b937c62ef38be6d8c011c0a3 (diff) | |
download | cmd2-git-47f8652fa467b2d140b1097b3167f968b0188451.tar.gz |
the with_argparse() decorator was incorrectly using a parsed statement object to search for the original function arguments. Switched to search for the original statement value instead1.3.7
Diffstat (limited to 'tests/test_cmd2.py')
-rwxr-xr-x | tests/test_cmd2.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 8688e124..3b240e4e 100755 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -217,6 +217,23 @@ def test_shell_last_result(base_app): run_cmd(base_app, 'shell fake') assert base_app.last_result is not None + +def test_shell_manual_call(base_app): + # Verifies crash from Issue #986 doesn't happen + cmds = [ + 'echo "hi"', + 'echo "there"', + 'echo "cmd2!"' + ] + cmd = ';'.join(cmds) + + base_app.do_shell(cmd) + + cmd = '&&'.join(cmds) + + base_app.do_shell(cmd) + + def test_base_py(base_app): # Make sure py can't edit Cmd.py_locals. It used to be that cmd2 was passing its py_locals # dictionary to the py environment instead of a shallow copy. |