From 8d8e2b12088c62666698a174d84d59f6d1606478 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 12 Jun 2026 12:31:23 +0000 Subject: [PATCH] =?UTF-8?q?Synthesise=20reduced-field=20windows=20for=20Rd?= =?UTF-8?q?SAP-Schema-19.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 720ae0ee..a674b5c6 100644 --- a/infrastructure/epc_client/tests/test_mapper_corpus.py +++ b/infrastructure/epc_client/tests/test_mapper_corpus.py @@ -80,3 +80,22 @@ def test_rdsap_19_0_maps() -> None: # Assert assert isinstance(result, EpcPropertyData) + + +def test_rdsap_19_0_synthesises_windows_for_windowless_cert() -> None: + """ADR-0028 Reduced-Field Synthesis: a reduced 19.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-19.0") + if not certs: + pytest.skip("no RdSAP-Schema-19.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]