From 47f8652fa467b2d140b1097b3167f968b0188451 Mon Sep 17 00:00:00 2001 From: Eric Lin Date: Thu, 27 Aug 2020 17:07:43 -0400 Subject: 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 instead --- tests/test_cmd2.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') 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. -- cgit v1.2.1