import pytest from agr_assistent.hotkey import HotkeyError, parse_hotkey @pytest.mark.parametrize( ("spec", "expected"), [ ("ctrl+alt+space", (0x0002 | 0x0001, 0x20)), ("Win + Shift + A", (0x0008 | 0x0004, ord("A"))), ("f12", (0, 0x7B)), ("ctrl+7", (0x0002, ord("7"))), ], ) def test_parse_hotkey(spec: str, expected: tuple[int, int]) -> None: assert parse_hotkey(spec) == expected @pytest.mark.parametrize("spec", ["", "ctrl+", "hyper+a", "ctrl+f25", "ctrl+ж"]) def test_parse_hotkey_rejects_invalid(spec: str) -> None: with pytest.raises(HotkeyError): parse_hotkey(spec)