diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-09-28 20:51:56 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-09-28 20:51:56 -0400 |
commit | 46bd94acbd10eced821827555a0ffd49a2f9cd92 (patch) | |
tree | 5b7f4893f7edfa60435946f1027b07933fe1b3cf /tests | |
parent | c2b1f611be7589ac2bdae34897d0140f5df75c9f (diff) | |
download | cmd2-git-46bd94acbd10eced821827555a0ffd49a2f9cd92.tar.gz |
Added more code coverage with unit tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_completion.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_completion.py b/tests/test_completion.py index e26b8a2f..1b7b65d2 100644 --- a/tests/test_completion.py +++ b/tests/test_completion.py @@ -948,6 +948,23 @@ def test_cmd2_help_subcommand_completion_with_flags_before_command(scu_app): first_match = complete_tester(text, line, begidx, endidx, scu_app) assert first_match is not None and scu_app.completion_matches == ['bar', 'foo', 'sport'] +def test_complete_help_subcommand_with_no_command(scu_app): + # No command because not enough tokens + text = '' + line = 'help ' + endidx = len(line) + begidx = endidx - len(text) + + assert not scu_app.complete_help_subcommand(text, line, begidx, endidx) + + # No command because everything is a flag + text = '-v' + line = 'help -f -v' + endidx = len(line) + begidx = endidx - len(text) + + assert not scu_app.complete_help_subcommand(text, line, begidx, endidx) + def test_cmd2_help_subcommand_completion_nomatch_scu(scu_app): text = 'z' |