From f7ae00019c6c831726c846705fb7bda5c222d375 Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 30 Aug 2026 18:59:59 +0300 Subject: [PATCH] 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 --- tests_backend/test_ha_websocket.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests_backend/test_ha_websocket.py b/tests_backend/test_ha_websocket.py index 1ff2d614..4fefc018 100644 --- a/tests_backend/test_ha_websocket.py +++ b/tests_backend/test_ha_websocket.py @@ -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"]