diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-11-11 14:04:13 -0500 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-11-11 14:04:13 -0500 |
commit | 28bdb95371cf1f9a6389998d0a5695a5672747b9 (patch) | |
tree | 05fb8b9504f72e2df6d94ec63f1e5bbd7ae47052 | |
parent | 39c1e71f55afad8f8a03457a1a9accf7c88e48c3 (diff) | |
download | cmd2-git-28bdb95371cf1f9a6389998d0a5695a5672747b9.tar.gz |
Updated unit tests
-rw-r--r-- | tests_isolated/test_commandset/test_commandset.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests_isolated/test_commandset/test_commandset.py b/tests_isolated/test_commandset/test_commandset.py index 805780d9..fb4ccd0f 100644 --- a/tests_isolated/test_commandset/test_commandset.py +++ b/tests_isolated/test_commandset/test_commandset.py @@ -746,7 +746,7 @@ class SupportFuncUserUnrelated(cmd2.CommandSet): self._cmd.poutput('something {}'.format(ns.state)) -def test_cross_commandset_completer(command_sets_manual): +def test_cross_commandset_completer(command_sets_manual, capsys): global complete_states_expected_self # This tests the different ways to locate the matching CommandSet when completing an argparse argument. # Exercises the 3 cases in cmd2.Cmd._resolve_func_self(). @@ -844,9 +844,11 @@ def test_cross_commandset_completer(command_sets_manual): endidx = len(line) begidx = endidx first_match = complete_tester(text, line, begidx, endidx, command_sets_manual) + out, err = capsys.readouterr() assert first_match is None assert command_sets_manual.completion_matches == [] + assert "Could not find CommandSet instance" in out command_sets_manual.unregister_command_set(user_unrelated) @@ -865,9 +867,11 @@ def test_cross_commandset_completer(command_sets_manual): endidx = len(line) begidx = endidx first_match = complete_tester(text, line, begidx, endidx, command_sets_manual) + out, err = capsys.readouterr() assert first_match is None assert command_sets_manual.completion_matches == [] + assert "Could not find CommandSet instance" in out command_sets_manual.unregister_command_set(user_unrelated) command_sets_manual.unregister_command_set(user_sub2) |