test: the jamb-margin harness assert reads the JSON details (#42)

The harness test still parsed the legacy 'space=... opening=...
margin_cm=...' string; #42 replaced that message with structured JSON
details (the client localizes from the code and reads the fields). The
assert now parses the payload and checks the same three facts.

User-Visible: no
Issue: #42
This commit is contained in:
Codex
2026-08-30 21:34:32 +03:00
parent 778da930cb
commit f7ae00019c
+7 -3
View File
@@ -1048,9 +1048,13 @@ async def test_config_writers_reject_partition_opening_without_jamb_atomically(
response = await client.receive_json()
assert not response["success"]
assert response["error"]["code"] == "invalid_partition_opening_jamb_margin"
assert "space=ground" in response["error"]["message"]
assert "opening=door" in response["error"]["message"]
assert "margin_cm=7.5" in response["error"]["message"]
# #42: the message is structured JSON details now (the legacy
# "space=... opening=... margin_cm=..." string is gone); the client
# localizes from the code and reads the fields from the JSON payload.
details = json.loads(response["error"]["message"])
assert details["space"] == "ground"
assert details["opening"] == "door"
assert details["margin_cm"] == 7.5
await client.send_json_auto_id({"type": "houseplan/config/get"})
stored = (await client.receive_json())["result"]