From c3e424ec69de31890ddadf67dee5fa903cbcd665 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Fri, 20 Mar 2020 12:19:30 -0400 Subject: do_shell() now saves the return code of the command it runs in self.last_result for use in pyscripts --- tests/test_cmd2.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 2db52d39..66ef33de 100755 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -203,6 +203,10 @@ def test_base_shell(base_app, monkeypatch): assert out == [] assert m.called +def test_shell_last_result(base_app): + base_app.last_result = None + run_cmd(base_app, 'shell fake') + assert base_app.last_result is not None 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 -- cgit v1.2.1