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

Function test_help_argparse_command_while_disabled

tests/test_cmd2.py:4047–4058  ·  view source on GitHub ↗
(disable_commands_app: DisableCommandsApp)

Source from the content-addressed store, hash-verified

4045
4046
4047def test_help_argparse_command_while_disabled(disable_commands_app: DisableCommandsApp) -> None:
4048 message_to_print = "This command is disabled"
4049 disable_commands_app.disable_command("argparse_command", message_to_print)
4050
4051 # help <command> should show the disabled message
4052 _out, err = run_cmd(disable_commands_app, "help argparse_command")
4053 assert err[0].startswith(message_to_print)
4054
4055 # Re-enabling should restore the real help
4056 disable_commands_app.enable_command("argparse_command")
4057 out, _err = run_cmd(disable_commands_app, "help argparse_command")
4058 assert "Usage: argparse_command" in out[0]
4059
4060
4061def test_help_disabled_no_help_func(base_app: cmd2.Cmd) -> None:

Callers

nothing calls this directly

Calls 3

run_cmdFunction · 0.85
disable_commandMethod · 0.80
enable_commandMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…