summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-09-17 10:04:25 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-09-17 10:04:25 -0400
commit17eefdeb934525772885ff31f80a0d5a016a5b52 (patch)
treeaf2c2be429ebf31183826fceaafe23581a38a3b4 /tests/test_cmd2.py
parent60ab11c3166a2a76bf67774c67b583d7d30fe5be (diff)
downloadcmd2-git-17eefdeb934525772885ff31f80a0d5a016a5b52.tar.gz
No longer printing all help text for alias and macro when the subcommand is omitted. Instead allow argparse to handle the error.
Diffstat (limited to 'tests/test_cmd2.py')
-rwxr-xr-xtests/test_cmd2.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index fc8a1dae..94a49a95 100755
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -1620,7 +1620,8 @@ def test_get_settable_completion_items(base_app):
def test_alias_no_subcommand(base_app):
out, err = run_cmd(base_app, 'alias')
- assert "Usage: alias [-h]" in out[0]
+ assert "Usage: alias [-h]" in err[0]
+ assert "Error: the following arguments are required: subcommand" in err[1]
def test_alias_create(base_app):
# Create the alias
@@ -1713,7 +1714,8 @@ def test_multiple_aliases(base_app):
def test_macro_no_subcommand(base_app):
out, err = run_cmd(base_app, 'macro')
- assert "Usage: macro [-h]" in out[0]
+ assert "Usage: macro [-h]" in err[0]
+ assert "Error: the following arguments are required: subcommand" in err[1]
def test_macro_create(base_app):
# Create the macro