summaryrefslogtreecommitdiff
path: root/tests/test_run_pyscript.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-04-11 13:04:52 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-04-11 13:04:52 -0400
commit2bac6bcda3b7c5b2ba7093955acf232dd89f9f0f (patch)
tree7f5e029e5a079faf14453655292d6ca9f56a6dee /tests/test_run_pyscript.py
parent0d4be64b6ec76fcf5f87933293dbc7c134a32cf0 (diff)
downloadcmd2-git-2bac6bcda3b7c5b2ba7093955acf232dd89f9f0f.tar.gz
Made some optional arguments with defaults keyword-only.
Added unit test for echo argument to pyscript app() command. Removed _relative_load from hidden commands since that command was renamed.
Diffstat (limited to 'tests/test_run_pyscript.py')
-rw-r--r--tests/test_run_pyscript.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test_run_pyscript.py b/tests/test_run_pyscript.py
index 811fd688..f050f508 100644
--- a/tests/test_run_pyscript.py
+++ b/tests/test_run_pyscript.py
@@ -91,7 +91,6 @@ def test_run_pyscript_dir(base_app, request):
python_script = os.path.join(test_dir, 'pyscript', 'pyscript_dir.py')
out, err = run_cmd(base_app, 'run_pyscript {}'.format(python_script))
- assert out
assert out[0] == "['cmd_echo']"
def test_run_pyscript_stdout_capture(base_app, request):
@@ -123,3 +122,11 @@ def test_run_pyscript_environment(base_app, request):
out, err = run_cmd(base_app, 'run_pyscript {}'.format(python_script))
assert out[0] == "PASSED"
+
+def test_run_pyscript_echp(base_app, request):
+ test_dir = os.path.dirname(request.module.__file__)
+ python_script = os.path.join(test_dir, 'pyscript', 'echo.py')
+ out, err = run_cmd(base_app, 'run_pyscript {}'.format(python_script))
+
+ # Only the edit help text should have been echoed to pytest's stdout
+ assert out[0] == "Usage: edit [-h] [file_path]"