Files
komorebi/nix/linux/tests/vm/lib/tests/test_keys.py
T
LGUG2Z f01853ceca refactor(repo): move the KDE and macOS nix files under nix/ (pure move)
komorebi-for-kde/nix/ -> nix/linux/
komorebi-for-mac/nix/ -> nix/macos/

The nix expressions of the platforms (modules, option files, VM test suites, kwin effects,
the darwin module) sit next to the existing nix/workspace-src.nix. Renames only (252
files); the flakes that import them are replaced by one root flake later in this stack, so
nix does not evaluate at this revision.
2026-11-05 15:03:27 -08:00

25 lines
680 B
Python

import pytest
from komorebi_vm import Keys
from .conftest import FakeMachine
def test_a_combo_is_sent_as_qemu_names_it(machine: FakeMachine) -> None:
keys = Keys(machine)
keys.send("alt-h")
keys.send("Meta-Shift-j")
keys.send("super-1")
keys.send("esc")
assert machine.keys == ["alt-h", "meta_l-shift-j", "meta_l-1", "esc"]
def test_a_word_that_is_not_a_modifier_is_refused(machine: FakeMachine) -> None:
with pytest.raises(ValueError, match="'hyper' in 'hyper-h' is not a modifier"):
Keys(machine).send("hyper-h")
with pytest.raises(ValueError, match="has no key"):
Keys(machine).send("alt-")
assert machine.keys == []