From 4c65640e4e11f3f3f05e02b4a5f6fb917ae2e74c Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 25 Jun 2026 20:54:46 +0000 Subject: [PATCH] =?UTF-8?q?Map=20display=20EnergyElements=20on=20full-SAP?= =?UTF-8?q?=20certs=20for=20the=20FE=20panel=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/domain/tests/test_from_sap_schema.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/datatypes/epc/domain/tests/test_from_sap_schema.py b/datatypes/epc/domain/tests/test_from_sap_schema.py index 0612f523..c5daa082 100644 --- a/datatypes/epc/domain/tests/test_from_sap_schema.py +++ b/datatypes/epc/domain/tests/test_from_sap_schema.py @@ -137,6 +137,34 @@ class TestFromSapSchema17_1RebaselineFields: assert result.assessment_type == "SAP" +class TestFromSapSchema17_1DisplayElements: + """Display EnergyElements the WIP mapper dropped, leaving the FE + property-details panel "Unknown" for full-SAP certs (ADR-0037). Brings + full-SAP to parity with from_rdsap_schema_17_1's display coverage.""" + + @pytest.fixture + def result(self) -> EpcPropertyData: + schema = from_dict(SapSchema17_1, load("sap_17_1.json")) + return EpcPropertyDataMapper.from_sap_schema_17_1(schema) + + def test_maps_main_heating_display_list(self, result: EpcPropertyData) -> None: + assert [e.description for e in result.main_heating] == [ + "Boiler and radiators, mains gas" + ] + + def test_maps_window_display_element(self, result: EpcPropertyData) -> None: + assert result.window is not None + assert result.window.description == "High performance glazing" + + def test_maps_lighting_display_element(self, result: EpcPropertyData) -> None: + assert result.lighting is not None + assert result.lighting.description == "Low energy lighting in all fixed outlets" + + def test_maps_hot_water_display_element(self, result: EpcPropertyData) -> None: + assert result.hot_water is not None + assert result.hot_water.description == "From main system" + + class TestFullSapHasHotWaterCylinderFallback: """Some full-SAP certs (e.g. SAP-Schema-17.0 cert 8265-7433-3220-9736-7902) omit the top-level `has_hot_water_cylinder` and lodge it only under