summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 94db1a8d..6b071035 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -84,6 +84,16 @@ def test_base_py(base_app, capsys):
assert out.rstrip() == '3'
+def test_base_run_python_script(base_app, capsys, request):
+ test_dir = os.path.dirname(request.module.__file__)
+ python_script = os.path.join(test_dir, 'script.py')
+ expected = 'This is a python script running ...\n'
+
+ run_cmd(base_app, "py run('{}')".format(python_script))
+ out, err = capsys.readouterr()
+ assert out == expected
+
+
def test_base_error(base_app):
out = run_cmd(base_app, 'meow')
assert out == ["*** Unknown syntax: meow"]