diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-08-07 18:52:50 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-08-07 18:52:50 -0400 |
commit | 6e6220eb36a1df77f45e6affeaa02fd114ed9fd4 (patch) | |
tree | 187a54954c401a11c79cb2d817226a1e282ab09f /tests | |
parent | 89a5a646ffa2f72154b932f0b2dbf23fd87866e3 (diff) | |
download | cmd2-git-6e6220eb36a1df77f45e6affeaa02fd114ed9fd4.tar.gz |
Verifying command names in __init__
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_cmd2.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 1ba10f6b..85246c96 100755 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -87,6 +87,10 @@ def test_base_shortcuts(base_app): expected = normalize(SHORTCUTS_TXT) assert out == expected +def test_command_starts_with_shortcut(): + with pytest.raises(ValueError) as excinfo: + app = cmd2.Cmd(shortcuts={'help': 'fake'}) + assert "Invalid command name 'help'" in str(excinfo.value) def test_base_show(base_app): # force editor to be 'vim' so test is repeatable across platforms |