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

Function test_get_parser_while_disabled

tests/test_cmd2.py:3995–4007  ·  view source on GitHub ↗

Test that command_parsers can find a disabled command's parser.

(disable_commands_app: DisableCommandsApp)

Source from the content-addressed store, hash-verified

3993
3994
3995def test_get_parser_while_disabled(disable_commands_app: DisableCommandsApp) -> None:
3996 """Test that command_parsers can find a disabled command's parser."""
3997 # Get parser before disabling
3998 parser_before = disable_commands_app.command_parsers.get(disable_commands_app.do_argparse_command)
3999 assert parser_before is not None
4000
4001 # Disable command
4002 disable_commands_app.disable_command("argparse_command", "Disabled")
4003
4004 # Get parser after disabling
4005 parser_after = disable_commands_app.command_parsers.get(disable_commands_app.do_argparse_command)
4006 assert parser_after is not None
4007 assert parser_after is parser_before
4008
4009
4010def test_metadata_preservation_while_disabled(disable_commands_app: DisableCommandsApp) -> None:

Callers

nothing calls this directly

Calls 2

disable_commandMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…