diff --git a/backend/ecmk_fetcher/tests/test_xml_processor.py b/backend/ecmk_fetcher/tests/test_xml_processor.py index 1a308177..3fd9e45e 100644 --- a/backend/ecmk_fetcher/tests/test_xml_processor.py +++ b/backend/ecmk_fetcher/tests/test_xml_processor.py @@ -172,6 +172,57 @@ def test_parse_rdsap_contract(): } +ND_THICKNESS_XML = """ + + +
+ 1 + Somewhere + AB1 2CD +
+
+
+ + + 0 + + + Main Dwelling + 4 + 2 + ND + + + 10.0 + 2.5 + 50.0 + 0 + 0 + + + + + + +
+""" + + +def test_parse_rdsap_nd_thickness(): + # 'ND' (not determined) is a valid value in the wild for Roof-Insulation-Thickness + # — it should be retained as-is rather than raising + + # arrange + act + result: SapPropertyDetails = parse_rdsap(ND_THICKNESS_XML) + + # assert + assert result["building_parts"][0]["roof"] == { + "construction": 4, + "insulation_location": 2, + "insulation_thickness_mm": "ND", + } + + def test_flatten_full(): # Two building parts; Main Dwelling has two floors + full roof, # Extension has one floor + partial roof (no thickness) diff --git a/datatypes/epc/domain/field_mappings.py b/datatypes/epc/domain/field_mappings.py index 55156d3d..cc0f9067 100644 --- a/datatypes/epc/domain/field_mappings.py +++ b/datatypes/epc/domain/field_mappings.py @@ -1 +1,3 @@ PROPERTY_TYPE_LOOKUP = {0: "House", 1: "Bungalow", 2: "Flat", 3: "Maisonette"} +ROOF_CONSTRUCTION_LOOKUP = {} +ROOF_INSULATION_LOCATION_LOOKUP = {}