MCPcopy Create free account
hub / github.com/python-cmd2/cmd2 / SupportFuncUserUnrelated

Class SupportFuncUserUnrelated

tests/test_commandset.py:828–841  ·  view source on GitHub ↗

A CommandSet that isn't related to SupportFuncProvider which uses its support function

Source from the content-addressed store, hash-verified

826
827
828class SupportFuncUserUnrelated(cmd2.CommandSet):
829 """A CommandSet that isn't related to SupportFuncProvider which uses its support function"""
830
831 def __init__(self, dummy) -> None:
832 """Dummy variable prevents this from being autoloaded in other tests"""
833 super().__init__()
834
835 parser = cmd2.Cmd2ArgumentParser()
836 parser.add_argument("state", type=str, completer=SupportFuncProvider.complete_states)
837
838 @cmd2.with_argparser(parser)
839 def do_user_unrelated(self, ns: argparse.Namespace) -> None:
840 """User Unrelated Command"""
841 self._cmd.poutput(f"something {ns.state}")
842
843
844def test_cross_commandset_completer(manual_command_sets_app) -> None:

Callers 1

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…