summaryrefslogtreecommitdiff
path: root/tests_isolated/test_commandset/test_commandset.py
diff options
context:
space:
mode:
authorEric Lin <anselor@gmail.com>2020-09-10 09:15:05 -0400
committeranselor <anselor@gmail.com>2020-09-11 13:50:45 -0400
commit872da20feba57f42dde204da01dc48c4c87e1b54 (patch)
tree37f7812aae5eddac9d8d37ead8b22828378e7497 /tests_isolated/test_commandset/test_commandset.py
parent6093e5e9c1b6366c67323f090d21696e867b6625 (diff)
downloadcmd2-git-872da20feba57f42dde204da01dc48c4c87e1b54.tar.gz
Changes default category to be heritable by default - meaning that subclasses will inherit the parent class's default category.
Adds optional flag to disable heritability.
Diffstat (limited to 'tests_isolated/test_commandset/test_commandset.py')
-rw-r--r--tests_isolated/test_commandset/test_commandset.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests_isolated/test_commandset/test_commandset.py b/tests_isolated/test_commandset/test_commandset.py
index d7f2523e..21cce8bf 100644
--- a/tests_isolated/test_commandset/test_commandset.py
+++ b/tests_isolated/test_commandset/test_commandset.py
@@ -685,6 +685,7 @@ def test_static_subcommands(static_subcommands_app):
complete_states_expected_self = None
+@cmd2.with_default_category('With Completer')
class WithCompleterCommandSet(cmd2.CommandSet):
states = ['alabama', 'alaska', 'arizona', 'arkansas', 'california', 'colorado', 'connecticut', 'delaware']
@@ -752,6 +753,8 @@ def test_cross_commandset_completer(command_sets_manual):
assert first_match == 'alabama'
assert command_sets_manual.completion_matches == WithCompleterCommandSet.states
+ assert getattr(command_sets_manual.cmd_func('case1').__func__, cmd2.constants.CMD_ATTR_HELP_CATEGORY) == 'With Completer'
+
command_sets_manual.unregister_command_set(case1_set)
####################################################################################################################