diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-06-15 00:51:20 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-06-15 00:51:20 -0400 |
commit | df8679b3331a8aebd3af4bbe2a0c6e625346f348 (patch) | |
tree | 527c3cd19726a6a4169252afec8c87e533e37d57 /tests | |
parent | 294cf8d4b2fd7254958c28211e5997bd45aa81cf (diff) | |
download | cmd2-git-df8679b3331a8aebd3af4bbe2a0c6e625346f348.tar.gz |
Fixed unit tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_completion.py | 2 | ||||
-rw-r--r-- | tests/test_history.py | 2 | ||||
-rw-r--r-- | tests/test_parsing.py | 6 | ||||
-rw-r--r-- | tests/test_pyscript.py | 12 |
4 files changed, 11 insertions, 11 deletions
diff --git a/tests/test_completion.py b/tests/test_completion.py index 0a16bc28..b70de7bc 100644 --- a/tests/test_completion.py +++ b/tests/test_completion.py @@ -149,7 +149,7 @@ def test_complete_exception(cmd2_app, capsys): def test_complete_macro(base_app, request): # Create the macro - out, err = run_cmd(base_app, 'macro create fake pyscript {1}') + out, err = run_cmd(base_app, 'macro create fake run_pyscript {1}') assert out == normalize("Macro 'fake' created") # Macros do path completion diff --git a/tests/test_history.py b/tests/test_history.py index a06bce87..973d8cff 100644 --- a/tests/test_history.py +++ b/tests/test_history.py @@ -275,7 +275,7 @@ def parser(): '42': 'theanswer', 'l': '!ls -al', 'anothermultiline': 'multiline', - 'fake': 'pyscript'}, + 'fake': 'run_pyscript'}, shortcuts=[('?', 'help'), ('!', 'shell')] ) return parser diff --git a/tests/test_parsing.py b/tests/test_parsing.py index 3bd635a1..13a535c0 100644 --- a/tests/test_parsing.py +++ b/tests/test_parsing.py @@ -20,7 +20,7 @@ def parser(): '42': 'theanswer', 'l': '!ls -al', 'anothermultiline': 'multiline', - 'fake': 'pyscript'}, + 'fake': 'run_pyscript'}, shortcuts=[('?', 'help'), ('!', 'shell')] ) return parser @@ -705,8 +705,8 @@ def test_parse_command_only_expands_alias(parser): assert statement == 'foobar.py "somebody.py' assert statement.args == statement assert statement.arg_list == [] - assert statement.command == 'pyscript' - assert statement.command_and_args == 'pyscript foobar.py "somebody.py' + assert statement.command == 'run_pyscript' + assert statement.command_and_args == 'run_pyscript foobar.py "somebody.py' assert statement.multiline_command == '' assert statement.raw == line assert statement.terminator == '' diff --git a/tests/test_pyscript.py b/tests/test_pyscript.py index 8da4b35a..aeed6fef 100644 --- a/tests/test_pyscript.py +++ b/tests/test_pyscript.py @@ -1,7 +1,7 @@ # coding=utf-8 # flake8: noqa E302 """ -Unit/functional testing for pytest in cmd2 +Unit/functional testing for run_pytest in cmd2 """ import os from cmd2 import plugin @@ -19,7 +19,7 @@ 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') out1, err1 = run_cmd(base_app, 'help') - out2, err2 = run_cmd(base_app, 'pyscript {}'.format(python_script)) + out2, err2 = run_cmd(base_app, 'run_pyscript {}'.format(python_script)) assert out1 and out1 == out2 @@ -27,7 +27,7 @@ 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') - out, err = run_cmd(base_app, 'pyscript {}'.format(python_script)) + out, err = run_cmd(base_app, 'run_pyscript {}'.format(python_script)) assert out assert out[0] == "['cmd_echo']" @@ -36,7 +36,7 @@ def test_pyscript_stdout_capture(base_app, request): base_app.register_cmdfinalization_hook(cmdfinalization_hook) test_dir = os.path.dirname(request.module.__file__) python_script = os.path.join(test_dir, 'pyscript', 'stdout_capture.py') - out, err = run_cmd(base_app, 'pyscript {} {}'.format(python_script, HOOK_OUTPUT)) + out, err = run_cmd(base_app, 'run_pyscript {} {}'.format(python_script, HOOK_OUTPUT)) assert out[0] == "PASSED" assert out[1] == "PASSED" @@ -47,10 +47,10 @@ def test_pyscript_stop(base_app, request): # help.py doesn't run any commands that returns True for stop python_script = os.path.join(test_dir, 'pyscript', 'help.py') - stop = base_app.onecmd_plus_hooks('pyscript {}'.format(python_script)) + stop = base_app.onecmd_plus_hooks('run_pyscript {}'.format(python_script)) assert not stop # stop.py runs the quit command which does return True for stop python_script = os.path.join(test_dir, 'pyscript', 'stop.py') - stop = base_app.onecmd_plus_hooks('pyscript {}'.format(python_script)) + stop = base_app.onecmd_plus_hooks('run_pyscript {}'.format(python_script)) assert stop |