Skip to content

Commit df8679b

Browse files
committed
Fixed unit tests
1 parent 294cf8d commit df8679b

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

tests/test_completion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def test_complete_exception(cmd2_app, capsys):
149149

150150
def test_complete_macro(base_app, request):
151151
# Create the macro
152-
out, err = run_cmd(base_app, 'macro create fake pyscript {1}')
152+
out, err = run_cmd(base_app, 'macro create fake run_pyscript {1}')
153153
assert out == normalize("Macro 'fake' created")
154154

155155
# Macros do path completion

tests/test_history.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def parser():
275275
'42': 'theanswer',
276276
'l': '!ls -al',
277277
'anothermultiline': 'multiline',
278-
'fake': 'pyscript'},
278+
'fake': 'run_pyscript'},
279279
shortcuts=[('?', 'help'), ('!', 'shell')]
280280
)
281281
return parser

tests/test_parsing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def parser():
2020
'42': 'theanswer',
2121
'l': '!ls -al',
2222
'anothermultiline': 'multiline',
23-
'fake': 'pyscript'},
23+
'fake': 'run_pyscript'},
2424
shortcuts=[('?', 'help'), ('!', 'shell')]
2525
)
2626
return parser
@@ -705,8 +705,8 @@ def test_parse_command_only_expands_alias(parser):
705705
assert statement == 'foobar.py "somebody.py'
706706
assert statement.args == statement
707707
assert statement.arg_list == []
708-
assert statement.command == 'pyscript'
709-
assert statement.command_and_args == 'pyscript foobar.py "somebody.py'
708+
assert statement.command == 'run_pyscript'
709+
assert statement.command_and_args == 'run_pyscript foobar.py "somebody.py'
710710
assert statement.multiline_command == ''
711711
assert statement.raw == line
712712
assert statement.terminator == ''

tests/test_pyscript.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding=utf-8
22
# flake8: noqa E302
33
"""
4-
Unit/functional testing for pytest in cmd2
4+
Unit/functional testing for run_pytest in cmd2
55
"""
66
import os
77
from cmd2 import plugin
@@ -19,15 +19,15 @@ def test_pyscript_help(base_app, request):
1919
test_dir = os.path.dirname(request.module.__file__)
2020
python_script = os.path.join(test_dir, 'pyscript', 'help.py')
2121
out1, err1 = run_cmd(base_app, 'help')
22-
out2, err2 = run_cmd(base_app, 'pyscript {}'.format(python_script))
22+
out2, err2 = run_cmd(base_app, 'run_pyscript {}'.format(python_script))
2323
assert out1 and out1 == out2
2424

2525

2626
def test_pyscript_dir(base_app, request):
2727
test_dir = os.path.dirname(request.module.__file__)
2828
python_script = os.path.join(test_dir, 'pyscript', 'pyscript_dir.py')
2929

30-
out, err = run_cmd(base_app, 'pyscript {}'.format(python_script))
30+
out, err = run_cmd(base_app, 'run_pyscript {}'.format(python_script))
3131
assert out
3232
assert out[0] == "['cmd_echo']"
3333

@@ -36,7 +36,7 @@ def test_pyscript_stdout_capture(base_app, request):
3636
base_app.register_cmdfinalization_hook(cmdfinalization_hook)
3737
test_dir = os.path.dirname(request.module.__file__)
3838
python_script = os.path.join(test_dir, 'pyscript', 'stdout_capture.py')
39-
out, err = run_cmd(base_app, 'pyscript {} {}'.format(python_script, HOOK_OUTPUT))
39+
out, err = run_cmd(base_app, 'run_pyscript {} {}'.format(python_script, HOOK_OUTPUT))
4040

4141
assert out[0] == "PASSED"
4242
assert out[1] == "PASSED"
@@ -47,10 +47,10 @@ def test_pyscript_stop(base_app, request):
4747

4848
# help.py doesn't run any commands that returns True for stop
4949
python_script = os.path.join(test_dir, 'pyscript', 'help.py')
50-
stop = base_app.onecmd_plus_hooks('pyscript {}'.format(python_script))
50+
stop = base_app.onecmd_plus_hooks('run_pyscript {}'.format(python_script))
5151
assert not stop
5252

5353
# stop.py runs the quit command which does return True for stop
5454
python_script = os.path.join(test_dir, 'pyscript', 'stop.py')
55-
stop = base_app.onecmd_plus_hooks('pyscript {}'.format(python_script))
55+
stop = base_app.onecmd_plus_hooks('run_pyscript {}'.format(python_script))
5656
assert stop

0 commit comments

Comments
 (0)