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

Function test_disable_category_twice

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

Source from the content-addressed store, hash-verified

4116
4117
4118def test_disable_category_twice(disable_commands_app) -> None:
4119 saved_len = len(disable_commands_app.disabled_categories)
4120 message_to_print = "These commands are currently disabled"
4121 disable_commands_app.disable_category("Test Category", message_to_print)
4122
4123 # The number of disabled categories should have increased one
4124 new_len = len(disable_commands_app.disabled_categories)
4125 assert saved_len == new_len - 1
4126 saved_len = new_len
4127
4128 # Disable again and the length should not change
4129 disable_commands_app.disable_category("Test Category", message_to_print)
4130 new_len = len(disable_commands_app.disabled_categories)
4131 assert saved_len == new_len
4132
4133
4134@pytest.mark.parametrize("silence_startup_script", [True, False])

Callers

nothing calls this directly

Calls 1

disable_categoryMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…