From 887af58a258474087c3a1f7a5f7fd26e364b537c Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 12 Jun 2026 12:46:27 +0000 Subject: [PATCH] =?UTF-8?q?Synthesise=20reduced-field=20windows=20for=20Rd?= =?UTF-8?q?SAP-Schema-17.0=20certs=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- .../epc_client/tests/test_mapper_corpus.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/infrastructure/epc_client/tests/test_mapper_corpus.py b/infrastructure/epc_client/tests/test_mapper_corpus.py index aa753ba1..ca8c06b4 100644 --- a/infrastructure/epc_client/tests/test_mapper_corpus.py +++ b/infrastructure/epc_client/tests/test_mapper_corpus.py @@ -96,3 +96,22 @@ def test_rdsap_19_0_synthesises_windows_for_windowless_cert() -> None: # Assert — N, E, S, W (SAP orientation codes 1, 3, 5, 7) assert [w.orientation for w in result.sap_windows] == [1, 3, 5, 7] + + +def test_rdsap_17_0_synthesises_windows_for_windowless_cert() -> None: + """ADR-0028 Reduced-Field Synthesis: a reduced 17.0 cert lodges no + per-window geometry, only a glazed_area band — the mapper synthesises a + 4-way N/E/S/W split rather than leaving the dwelling windowless.""" + # Arrange — a band-1 cert with no lodged sap_windows array + certs = _load("RdSAP-Schema-17.0") + if not certs: + pytest.skip("no RdSAP-Schema-17.0 corpus harvested") + cert = next( + c for c in certs if c.get("glazed_area") == 1 and not c.get("sap_windows") + ) + + # Act + result = EpcPropertyDataMapper.from_api_response(cert) + + # Assert — N, E, S, W (SAP orientation codes 1, 3, 5, 7) + assert [w.orientation for w in result.sap_windows] == [1, 3, 5, 7]