Lodge the surveyed Wall Dry-Lined answer on the SAP building part 🟥

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-14 23:21:36 +00:00
parent 483b69ff41
commit 073e5ce30c

View file

@ -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