diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-20 20:23:14 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-20 20:23:14 -0400 |
commit | 9ffb1ffa80724b10e5be5563fdefcf67a5abff41 (patch) | |
tree | 4df73432c1c50fc01e87847362cc12986e424686 /tests/test_pyscript.py | |
parent | d16a20fe14ed02e389ccde99d114e7335740e162 (diff) | |
download | cmd2-git-9ffb1ffa80724b10e5be5563fdefcf67a5abff41.tar.gz |
Made run_cmd return out and err
Diffstat (limited to 'tests/test_pyscript.py')
-rw-r--r-- | tests/test_pyscript.py | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/tests/test_pyscript.py b/tests/test_pyscript.py index 78500185..6981980b 100644 --- a/tests/test_pyscript.py +++ b/tests/test_pyscript.py @@ -11,21 +11,15 @@ from .conftest import run_cmd def test_pyscript_help(base_app, request): test_dir = os.path.dirname(request.module.__file__) python_script = os.path.join(test_dir, 'pyscript', 'help.py') - expected = run_cmd(base_app, 'help') + out1, err1 = run_cmd(base_app, 'help') + out2, err2 = run_cmd(base_app, 'pyscript {}'.format(python_script)) + assert out1 and out1 == out2 - assert len(expected) > 0 - assert len(expected[0]) > 0 - out = run_cmd(base_app, 'pyscript {}'.format(python_script)) - assert len(out) > 0 - assert out == expected - -def test_pyscript_dir(base_app, capsys, request): +def test_pyscript_dir(base_app, request): test_dir = os.path.dirname(request.module.__file__) python_script = os.path.join(test_dir, 'pyscript', 'pyscript_dir.py') - run_cmd(base_app, 'pyscript {}'.format(python_script)) - out, _ = capsys.readouterr() - out = out.strip() - assert len(out) > 0 - assert out == "['cmd_echo']" + out, err = run_cmd(base_app, 'pyscript {}'.format(python_script)) + assert out + assert out[0] == "['cmd_echo']" |