From 951bee3115d365c0e8373eba44a6117aac646d01 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 25 Jun 2026 20:36:38 +0000 Subject: [PATCH] =?UTF-8?q?Map=20property=5Ftype=20on=20full-SAP=20certs?= =?UTF-8?q?=20for=20correct=20heat-transmission=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) --- datatypes/epc/domain/tests/test_from_sap_schema.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/datatypes/epc/domain/tests/test_from_sap_schema.py b/datatypes/epc/domain/tests/test_from_sap_schema.py index dd8f021dd..5eb64a6ab 100644 --- a/datatypes/epc/domain/tests/test_from_sap_schema.py +++ b/datatypes/epc/domain/tests/test_from_sap_schema.py @@ -95,6 +95,17 @@ class TestFromSapSchema17_1RebaselineFields: assert result.sap_version == 9.92 + def test_maps_property_type_as_gov_code_string(self) -> None: + # property_type feeds the calculator (heat_transmission `_is_house` / + # `_is_flat_or_maisonette` drive party-wall + heat-loss handling). Left + # None, the dwelling is classified as neither → degraded SAP. The fixture + # is a flat (gov code 2); mapped as a string like from_rdsap_schema_17_1. + schema = from_dict(SapSchema17_1, load("sap_17_1.json")) + + result = EpcPropertyDataMapper.from_sap_schema_17_1(schema) + + assert result.property_type == "2" + class TestFullSapHasHotWaterCylinderFallback: """Some full-SAP certs (e.g. SAP-Schema-17.0 cert 8265-7433-3220-9736-7902)