summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-20 23:44:36 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-20 23:44:36 -0400
commit2bee50a0b4caecda05ee385419bd927cfcac9cf1 (patch)
treedf02ff354d5ebd3592dac8faa8f2ba0c6f7a7d97
parenta266446746c49f55c3447c467f053f88c2059c66 (diff)
downloadcmd2-git-2bee50a0b4caecda05ee385419bd927cfcac9cf1.tar.gz
Added unit test for run_script
-rw-r--r--tests/test_cmd2.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 1bdbea5f..9ce02789 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -331,6 +331,12 @@ def test_run_script_with_binary_file(base_app, request):
out, err = run_cmd(base_app, 'run_script {}'.format(filename))
assert "is not an ASCII or UTF-8 encoded text file" in err[0]
+def test_run_script_with_python_file(base_app, request):
+ test_dir = os.path.dirname(request.module.__file__)
+ filename = os.path.join(test_dir, 'pyscript', 'stop.py')
+ out, err = run_cmd(base_app, 'run_script {}'.format(filename))
+ assert "appears to be a Python file" in err[0]
+
def test_run_script_with_utf8_file(base_app, request):
test_dir = os.path.dirname(request.module.__file__)
filename = os.path.join(test_dir, 'scripts', 'utf8.txt')