Skip to content

Commit 38f9da6

Browse files
committed
Added unit test for categorized command without a docstring
1 parent 895b2da commit 38f9da6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_cmd2.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,6 +1236,11 @@ def do_diddly(self, arg):
12361236
"""This command does diddly"""
12371237
pass
12381238

1239+
# This command will be in the "Some Category" section of the help menu even though it has no docstring
1240+
@cmd2.with_category("Some Category")
1241+
def do_cat_nodoc(self, arg):
1242+
pass
1243+
12391244
def do_squat(self, arg):
12401245
"""This docstring help will never be shown because the help_squat method overrides it."""
12411246
pass
@@ -1269,7 +1274,7 @@ def test_help_cat_base(helpcat_app):
12691274
12701275
Some Category
12711276
=============
1272-
diddly
1277+
cat_nodoc diddly
12731278
12741279
Other
12751280
=====
@@ -1292,6 +1297,7 @@ def test_help_cat_verbose(helpcat_app):
12921297
12931298
Some Category
12941299
================================================================================
1300+
cat_nodoc
12951301
diddly This command does diddly
12961302
12971303
Other

0 commit comments

Comments
 (0)