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]