summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-05-06 23:45:03 -0400
committerGitHub <noreply@github.com>2019-05-06 23:45:03 -0400
commit673d8a1bebcada7f0182758acfe7f65637113286 (patch)
tree26e9218f325651e15f7e0f0751ca6e87848055fe /tests/test_cmd2.py
parent91e271013c8580f3308d593c2d3224ecf00d8b2f (diff)
parent14b33bb75667aef485119e4616de811e86547f69 (diff)
downloadcmd2-git-673d8a1bebcada7f0182758acfe7f65637113286.tar.gz
Merge pull request #672 from python-cmd2/argparse_error
ACArgumentParser no longer prints complete help text when a parsing error occurs
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 300e3ed9..37e8b60e 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -82,8 +82,8 @@ def test_base_argparse_help(base_app):
def test_base_invalid_option(base_app):
out, err = run_cmd(base_app, 'set -z')
- assert 'Error: unrecognized arguments: -z' in err[0]
- assert out[0] == 'Usage: set [-h] [-a] [-l] [param] [value]'
+ assert err[0] == 'Usage: set [-h] [-a] [-l] [param] [value]'
+ assert 'Error: unrecognized arguments: -z' in err[1]
def test_base_shortcuts(base_app):
out, err = run_cmd(base_app, 'shortcuts')
@@ -285,7 +285,7 @@ def test_pyscript_with_exception(base_app, request):
def test_pyscript_requires_an_argument(base_app):
out, err = run_cmd(base_app, "pyscript")
- assert "the following arguments are required: script_path" in err[0]
+ assert "the following arguments are required: script_path" in err[1]
def test_base_error(base_app):
@@ -314,7 +314,7 @@ def test_load_with_empty_args(base_app):
out, err = run_cmd(base_app, 'load')
# The load command requires a file path argument, so we should get an error message
- assert "the following arguments are required" in err[0]
+ assert "the following arguments are required" in err[1]
assert base_app.cmdqueue == []
@@ -448,7 +448,7 @@ def test_base_relative_load(base_app, request):
def test_relative_load_requires_an_argument(base_app):
out, err = run_cmd(base_app, '_relative_load')
- assert 'Error: the following arguments' in err[0]
+ assert 'Error: the following arguments' in err[1]
assert base_app.cmdqueue == []
@@ -1590,7 +1590,7 @@ def test_alias_create(base_app):
# Use the alias
out, err = run_cmd(base_app, 'fake')
- assert "the following arguments are required: script_path" in err[0]
+ assert "the following arguments are required: script_path" in err[1]
# See a list of aliases
out, err = run_cmd(base_app, 'alias list')
@@ -1681,7 +1681,7 @@ def test_macro_create(base_app):
# Use the macro
out, err = run_cmd(base_app, 'fake')
- assert "the following arguments are required: script_path" in err[0]
+ assert "the following arguments are required: script_path" in err[1]
# See a list of macros
out, err = run_cmd(base_app, 'macro list')