summaryrefslogtreecommitdiff
path: root/tests/test_argparse_completer.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-15 16:29:06 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-15 16:29:06 -0400
commit218091f1ae3fd9ee0435fb126ea8e032ed3de76f (patch)
tree635d267f3a84ae84117e64416e16ad438642e6db /tests/test_argparse_completer.py
parent2e541a8a9a52ec23f5e337175314606ce2702381 (diff)
downloadcmd2-git-218091f1ae3fd9ee0435fb126ea8e032ed3de76f.tar.gz
Added ability to specify nargs ranges with no upper bound
Diffstat (limited to 'tests/test_argparse_completer.py')
-rw-r--r--tests/test_argparse_completer.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/test_argparse_completer.py b/tests/test_argparse_completer.py
index 1262b9e1..4ad4c560 100644
--- a/tests/test_argparse_completer.py
+++ b/tests/test_argparse_completer.py
@@ -596,10 +596,7 @@ def test_unfinished_flag_error(ac_app, command_and_args, text, is_error, capsys)
complete_tester(text, line, begidx, endidx, ac_app)
out, err = capsys.readouterr()
- if is_error:
- assert "Flag requires" in out
- else:
- assert "Flag requires" not in out
+ assert is_error == all(x in out for x in ["Error:\n", "expected"])
def test_completion_items_default_header(ac_app):
@@ -651,11 +648,7 @@ def test_autocomp_hint(ac_app, command_and_args, text, has_hint, capsys):
complete_tester(text, line, begidx, endidx, ac_app)
out, err = capsys.readouterr()
-
- if has_hint:
- assert "Hint" in out
- else:
- assert "Hint" not in out
+ assert has_hint == ("Hint:\n" in out)
def test_autocomp_hint_multiple_lines(ac_app, capsys):