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

Function test_disable_command_twice

tests/test_cmd2.py:3970–3983  ·  view source on GitHub ↗
(disable_commands_app)

Source from the content-addressed store, hash-verified

3968
3969
3970def test_disable_command_twice(disable_commands_app) -> None:
3971 saved_len = len(disable_commands_app.disabled_commands)
3972 message_to_print = "These commands are currently disabled"
3973 disable_commands_app.disable_command("has_helper_func", message_to_print)
3974
3975 # The number of disabled commands should have increased one
3976 new_len = len(disable_commands_app.disabled_commands)
3977 assert saved_len == new_len - 1
3978 saved_len = new_len
3979
3980 # Disable again and the length should not change
3981 disable_commands_app.disable_command("has_helper_func", message_to_print)
3982 new_len = len(disable_commands_app.disabled_commands)
3983 assert saved_len == new_len
3984
3985
3986def test_disabled_command_not_in_history(disable_commands_app) -> None:

Callers

nothing calls this directly

Calls 1

disable_commandMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…