Implement story 1.2: config read/write/wipe

Add provisioning/config.py with read/write/wipe functions, update
conftest.py with autouse CONFIG_PATH patch fixture, write 7 tests
covering all acceptance criteria, and extend pyproject.toml
per-file-ignores so conftest.py may import from provisioning.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Edholm
2026-04-22 22:35:11 -04:00
parent 8682b8714e
commit 826f1d98fa
6 changed files with 122 additions and 31 deletions
+22 -1
View File
@@ -1 +1,22 @@
# stub
import json
from pathlib import Path
from planemapper.constants import CONFIG_PATH as _CONFIG_PATH
# Module-level reference so tests can monkeypatch this name
CONFIG_PATH: Path = _CONFIG_PATH
def read() -> dict:
with CONFIG_PATH.open() as f:
return json.load(f)
def write(data: dict) -> None:
CONFIG_PATH.parent.mkdir(parents=True, exist_ok=True)
with CONFIG_PATH.open("w") as f:
json.dump(data, f, indent=2)
def wipe() -> None:
CONFIG_PATH.unlink(missing_ok=True)