Withhold roof insulation from RIR surfaces the surveyor marked insulation-unknown 🟥

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-14 23:17:30 +00:00
parent 8e58f7e871
commit 7f854e7219

View file

@ -252,6 +252,50 @@ class TestRoomInRoofMapping:
# Assert
assert result.sap_building_parts[0].sap_room_in_roof is None
def test_insulation_not_threaded_when_surveyor_answered_not_known(
self,
) -> None:
"""On the survey form that asks per surface "Are you able to provide
details of the insulation ?", a "No" means the surveyor could NOT
confirm insulation for that surface (fixture 499617935574: loft hatch
screwed shut) the roof-space thickness must not be threaded into it,
leaving the Table 18 col(4) age-band "unknown" default. Common walls
are never asked on this form, so they stay unthreaded too. The
legacy form (no question lodged anywhere; the `_RIR` fixture above)
keeps threading pinned by `test_room_in_roof_reaches_building_part`.
"""
# Arrange — the verbatim 499617935574 answers: gables Yes, slopes and
# flat ceiling No, common walls never asked.
data = load("pashub_rdsap_site_notes_example1.json")
data["roof_space"]["main_building"]["rooms_in_roof"] = True
rir = json.loads(json.dumps(self._RIR))
for gable in rir["gables"]:
gable["insulation_known"] = True
for slope in rir["slopes"]:
slope["insulation_known"] = False
rir["flat_ceilings"][0]["insulation_known"] = False
data["roof_space"]["main_building"]["room_in_roof"] = rir
survey = from_dict(PasHubRdSapSiteNotes, data)
# Act
mapped = EpcPropertyDataMapper.from_site_notes(survey).sap_building_parts[
0
].sap_room_in_roof
# Assert
assert mapped is not None
surfaces = mapped.detailed_surfaces
assert surfaces is not None
assert [(s.kind, s.insulation_thickness_mm) for s in surfaces] == [
("gable_wall_external", None),
("gable_wall", None),
("slope", None),
("slope", None),
("stud_wall", None),
("stud_wall", None),
("flat_ceiling", None),
]
class TestSystemBuildWallIsNotBasement:
"""RdSAP wall-construction code 6 is overloaded: PasHub "System Build