Fix stuff, apply ruff rules.

This commit is contained in:
2026-04-11 20:55:30 -04:00
parent b38d10575e
commit 09c03ad06a
26 changed files with 1466 additions and 30 deletions
+23
View File
@@ -348,6 +348,29 @@ class TestInputEventManager:
if case["expects_debug_call"]:
essential_modules["cthulhu.debug"].print_tokens.assert_called()
def test_add_grabs_for_keybinding_allows_default_cthulhu_modifiers(
self,
test_context: CthulhuTestContext,
) -> None:
"""Plugin bindings can be grabbed before a script supplies modifier keys."""
input_event_manager, _essential_modules = self._setup_input_event_manager(test_context)
mock_device = test_context.Mock()
mock_device.add_key_grab.return_value = 123
input_event_manager._device = mock_device
mock_kd = test_context.Mock()
mock_binding = test_context.Mock()
mock_binding.has_grabs.return_value = False
mock_binding.key_definitions.return_value = [mock_kd]
result = input_event_manager.add_grabs_for_keybinding(mock_binding)
assert result == [123]
mock_binding.key_definitions.assert_called_once_with(None)
mock_device.add_key_grab.assert_called_once_with(mock_kd, None)
@pytest.mark.parametrize(
"case",
[