summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-08-07 18:52:50 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-08-07 18:52:50 -0400
commit6e6220eb36a1df77f45e6affeaa02fd114ed9fd4 (patch)
tree187a54954c401a11c79cb2d817226a1e282ab09f /tests
parent89a5a646ffa2f72154b932f0b2dbf23fd87866e3 (diff)
downloadcmd2-git-6e6220eb36a1df77f45e6affeaa02fd114ed9fd4.tar.gz
Verifying command names in __init__
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_cmd2.py4
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