diff --git a/datatypes/epc/domain/tests/test_from_rdsap_schema.py b/datatypes/epc/domain/tests/test_from_rdsap_schema.py index 3c64edc2..8e88bb77 100644 --- a/datatypes/epc/domain/tests/test_from_rdsap_schema.py +++ b/datatypes/epc/domain/tests/test_from_rdsap_schema.py @@ -1525,3 +1525,31 @@ class TestRdSap18_0ReducedFieldSynthesis: assert sorted(w.orientation for w in result.sap_windows) == [1, 3, 5, 7] total_area = sum(w.window_width * w.window_height for w in result.sap_windows) assert total_area == pytest.approx(0.148 * tfa) + + def test_band_more_than_typical_scales_glazing_by_1_25(self) -> None: + # Arrange — ADR-0028: the glazed_area band scales synthesised area off the + # Normal ratio. Band 2 ("More than typical") = 1.25, the inherited 20.0.0 + # multiplier (18.0's 26 band-2 windowless certs can't re-fit it — no + # measured band-2 windows — so it is reused, not re-derived). A band-2 + # cert with no per-window array. + corpus = _load_18_0_corpus() + if not corpus: + pytest.skip("no RdSAP-Schema-18.0 corpus harvested") + cert = next( + ( + c + for c in corpus + if not c.get("sap_windows") and c.get("glazed_area") == 2 + ), + None, + ) + if cert is None: + pytest.skip("no band-2 corpus cert without sap_windows") + tfa = float(cert["total_floor_area"]) + + # Act + result = EpcPropertyDataMapper.from_api_response(cert) + + # Assert + total_area = sum(w.window_width * w.window_height for w in result.sap_windows) + assert total_area == pytest.approx(0.148 * tfa * 1.25)