From 073e5ce30c97d743152ac5add80a282e039d7e07 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 14 Jul 2026 23:21:36 +0000 Subject: [PATCH] =?UTF-8?q?Lodge=20the=20surveyed=20Wall=20Dry-Lined=20ans?= =?UTF-8?q?wer=20on=20the=20SAP=20building=20part=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- .../epc/domain/tests/test_from_site_notes.py | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/datatypes/epc/domain/tests/test_from_site_notes.py b/datatypes/epc/domain/tests/test_from_site_notes.py index b5bc4f29b..77c7ed4fd 100644 --- a/datatypes/epc/domain/tests/test_from_site_notes.py +++ b/datatypes/epc/domain/tests/test_from_site_notes.py @@ -297,6 +297,56 @@ class TestRoomInRoofMapping: ] +class TestWallDryLinedMapping: + """A surveyed "Wall Dry-Lined? Yes" must reach + `sap_building_parts[*].wall_dry_lined` โ€” the flag the wall-U cascade + reads for the RdSAP10 ยง5.8 / Table 14 adjustment (1/(1/U + 0.17)). + Dropped, a dry-lined wall is billed at the full uninsulated Table 6 U + (19% of the Guinness accuracy cohort lodges a "Yes"; already mapped on + the Elmhurst/API path, silently None on the pashub site-notes path).""" + + def test_main_building_answer_reaches_building_part(self) -> None: + # Arrange + data = load("pashub_rdsap_site_notes_example1.json") + data["building_construction"]["main_building"]["dry_lined"] = True + survey = from_dict(PasHubRdSapSiteNotes, data) + + # Act + result = EpcPropertyDataMapper.from_site_notes(survey) + + # Assert + assert result.sap_building_parts[0].wall_dry_lined is True + + def test_extension_answer_reaches_building_part(self) -> None: + # Arrange + data = load("pashub_rdsap_site_notes_example2.json") + data["building_construction"]["extensions"][0]["dry_lined"] = False + survey = from_dict(PasHubRdSapSiteNotes, data) + + # Act + result = EpcPropertyDataMapper.from_site_notes(survey) + + # Assert + extension_part = next( + bp + for bp in result.sap_building_parts + if bp.identifier != BuildingPartIdentifier.MAIN + ) + assert extension_part.wall_dry_lined is False + + def test_not_asked_stays_unknown(self) -> None: + # Arrange โ€” the fixture as lodged (no "Wall Dry-Lined?" answer). + survey = from_dict( + PasHubRdSapSiteNotes, load("pashub_rdsap_site_notes_example1.json") + ) + + # Act + result = EpcPropertyDataMapper.from_site_notes(survey) + + # Assert โ€” unknown, NOT a "No". + assert result.sap_building_parts[0].wall_dry_lined is None + + class TestSystemBuildWallIsNotBasement: """RdSAP wall-construction code 6 is overloaded: PasHub "System Build (i.e Any Other)" maps to 6, but 6 doubles as the gov-API basement-wall