MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / test_help_disabled_no_help_func

Function test_help_disabled_no_help_func

tests/test_cmd2.py:4061–4070  ·  view source on GitHub ↗
(base_app: cmd2.Cmd)

Source from the content-addressed store, hash-verified

4059
4060
4061def test_help_disabled_no_help_func(base_app: cmd2.Cmd) -> None:
4062 from cmd2.cmd2 import DisabledCommand
4063
4064 # Intentionally bypass disable_command() to test the fallback in do_help()
4065 command = "quit"
4066 command_func = cast(BoundCommandFunc, base_app.get_command_func(command))
4067 base_app.disabled_commands[command] = DisabledCommand(command_func=command_func, help_func=None, completer_func=None)
4068
4069 _out, err = run_cmd(base_app, f"help {command}")
4070 assert err[0].startswith(f"{command} is currently disabled.")
4071
4072
4073def test_register_command_in_enabled_category(disable_commands_app) -> None:

Callers

nothing calls this directly

Calls 3

DisabledCommandClass · 0.90
run_cmdFunction · 0.85
get_command_funcMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…