Files
komorebi/e2e/platforms/qemu_windows/extras/config_file.py
T
LGUG2Z 7054d02110 feat(e2e): add what only Windows checks as extras
padding (the border's 7 px), cloaking (and what stop does to it), the
config file watch, the system's window tracking behind focus follows
mouse, and a second display with a window sent to it. Each is run after
the tiling windows as windows_<name>, its checks labelled [windows].
2026-10-30 18:22:44 -07:00

37 lines
1.3 KiB
Python

"""kfw watches the configuration file it was started with."""
import json
from komorebi_vm.core.checks import Checks
from komorebi_vm.core.platform import Client
from ..windows_platform import CONFIG_PATH, WindowsPlatform
def _config(name: str) -> dict:
return {"monitors": [{"workspaces": [{"name": name, "layout": "BSP"}]}]}
def _name(platform: WindowsPlatform) -> str | None:
return platform.state().monitors[0].workspaces[0].name
def run(platform: WindowsPlatform, checks: Checks, clients: list[Client]) -> None:
"""Starts the daemon from a file and changes the file on disk. The daemon
runs at the end, on the new file."""
platform.restart_with(_config("before"))
checks.check("the daemon starts with the name in the file", _name(platform) == "before")
changed = platform._out / "komorebi-changed.json"
changed.write_text(json.dumps(_config("after")))
platform._agent.put_file(changed, CONFIG_PATH)
checks.check(
"a changed file is read by the daemon on its own",
platform.wait_for(lambda: _name(platform) == "after", timeout=30),
)
platform.komorebic("replace-configuration", CONFIG_PATH)
checks.check(
"`replace-configuration` reads it again and the name stays",
platform.wait_for(lambda: _name(platform) == "after", timeout=10),
)