(disable_commands_app: DisableCommandsApp)
| 4045 | |
| 4046 | |
| 4047 | def 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 | |
| 4061 | def test_help_disabled_no_help_func(base_app: cmd2.Cmd) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…