summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index acf9d610..a8278351 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -258,7 +258,7 @@ def test_base_error(base_app):
assert "is not a recognized command" in err[0]
-def test_base_run_script(base_app, request):
+def test_run_script(base_app, request):
test_dir = os.path.dirname(request.module.__file__)
filename = os.path.join(test_dir, 'script.txt')
@@ -285,6 +285,11 @@ def test_base_run_script(base_app, request):
assert script_out == manual_out
assert script_err == manual_err
+def test_load_deprecated(base_app):
+ """Delete this when load alias is removed"""
+ _, err = run_cmd(base_app, "load fake")
+ assert "load has been renamed and will be removed" in err[0]
+
def test_run_script_with_empty_args(base_app):
out, err = run_cmd(base_app, 'run_script')
assert "the following arguments are required" in err[1]
@@ -359,7 +364,7 @@ set colors Never""" % initial_run
out, err = run_cmd(base_app, 'history -s')
assert out == normalize(expected)
-def test_base_runcmds_plus_hooks(base_app, request):
+def test_runcmds_plus_hooks(base_app, request):
test_dir = os.path.dirname(request.module.__file__)
prefilepath = os.path.join(test_dir, 'scripts', 'precmds.txt')
postfilepath = os.path.join(test_dir, 'scripts', 'postcmds.txt')
@@ -379,7 +384,7 @@ set colors Never""" % (prefilepath, postfilepath)
out, err = run_cmd(base_app, 'history -s')
assert out == normalize(expected)
-def test_base_relative_run_script(base_app, request):
+def test_relative_run_script(base_app, request):
test_dir = os.path.dirname(request.module.__file__)
filename = os.path.join(test_dir, 'script.txt')
@@ -410,6 +415,10 @@ def test_relative_run_script_requires_an_argument(base_app):
out, err = run_cmd(base_app, '_relative_run_script')
assert 'Error: the following arguments' in err[1]
+def test_relative_load_deprecated(base_app):
+ """Delete this when _relative_load alias is removed"""
+ _, err = run_cmd(base_app, "_relative_load fake")
+ assert "_relative_load has been renamed and will be removed" in err[0]
def test_output_redirection(base_app):
fd, filename = tempfile.mkstemp(prefix='cmd2_test', suffix='.txt')