Synthesise reduced-field windows for RdSAP-Schema-19.0 certs 🟥

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jun-te Kim 2026-06-12 12:31:23 +00:00
parent 792f76f2fa
commit 8d8e2b1208

View file

@ -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]