summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-06-24 17:25:49 -0400
committerGitHub <noreply@github.com>2017-06-24 17:25:49 -0400
commit829973e473044cb4d3d8fb5dd55ff09aefb46d5e (patch)
tree7f5f4d4b7d9d62361538d10145dc8dbadd9af880 /tests/test_cmd2.py
parentb72a8ba7eed899ee8c44da36aa2636496bff89c7 (diff)
parent97a4f49948db468a247f4dd9862440cddc5e3db2 (diff)
downloadcmd2-git-829973e473044cb4d3d8fb5dd55ff09aefb46d5e.tar.gz
Merge pull request #138 from python-cmd2/unit_tests
Add path completion unit tests
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 757ed418..c1d406f4 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -111,6 +111,18 @@ def test_base_run_python_script(base_app, capsys, request):
assert out == expected
+@pytest.mark.skipif(sys.platform == 'win32',
+ reason="Unit test doesn't work on win32, but feature does")
+def test_base_run_pyscript(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, "pyscript {}".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"]