test(layouts): RED phase tests for default layout install-on-empty-INI behavior

3 tests in tests/test_default_layout_install.py per spec G6/G7 acceptance:
- test_default_layout_installed_when_ini_missing
- test_default_layout_installed_when_ini_empty
- test_default_layout_NOT_installed_when_layout_present

Currently fail as expected (no install helper exists yet). Test 3 passes as
a positive control (custom user INI is preserved when no install logic
runs).

Subprocess spawn pattern: each test creates its own tmp_path workspace,
spawns sloppy.py without --enable-test-hooks (avoids port-8999 conflict
with the live_gui session fixture's subprocess), waits 5s, terminates
via taskkill /F /T, asserts on the saved INI content.

state.toml: phase 1 marked completed; tasks t1_1-t1_10 recorded with
SHA 7577d7d. plan.md updated for Phase 1 task completion.
This commit is contained in:
ed
2026-06-29 14:39:56 -04:00
parent 9f1d8cb2d8
commit 35f22e4dd3
3 changed files with 169 additions and 13 deletions
@@ -46,7 +46,7 @@ Focus: relocate `tests/artifacts/manualslop_layout_default.ini` to `layouts/defa
Focus: ship `layouts/default.ini` to `cwd/manualslop_layout.ini` when the file is missing/empty/small, before `immapp.run(...)` reads it.
- [ ] Task 2.1: Write failing test for install behavior
- [~] Task 2.1: Write failing test for install behavior (Tier 3 dispatching tests/test_default_layout_install.py)
- WHERE: new file `tests/test_default_layout_install.py`
- WHAT: red phase — 3 tests:
1. `test_default_layout_installed_when_ini_missing` — `os.remove(cwd/manualslop_layout.ini)` before launch; `subprocess.Popen(sloppy_args, cwd=temp_workspace)`; wait ≥ 5s; assert `manualslop_layout.ini` exists with `[Window][Project Settings]` entry + a non-empty `DockId=` line