mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
Keep a PasHub system-build wall off the basement cascade 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
de15bd1ed7
commit
5980b2d6ed
1 changed files with 26 additions and 0 deletions
|
|
@ -122,6 +122,32 @@ class TestPhotovoltaicArrayMapping:
|
|||
assert result.sap_energy_source.photovoltaic_arrays 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
|
||||
sentinel — with `wall_is_basement` left None, `main_wall_is_basement`
|
||||
falls back to the code check and silently routes the dwelling through the
|
||||
basement wall/floor cascade (issue #1590 bug 7). The mapper must pin the
|
||||
flag False: a surveyed system-build wall is never a basement lodging.
|
||||
"""
|
||||
|
||||
def test_system_build_wall_does_not_route_to_basement(self) -> None:
|
||||
# Arrange
|
||||
data = load("pashub_rdsap_site_notes_example1.json")
|
||||
data["building_construction"]["main_building"][
|
||||
"walls_construction_type"
|
||||
] = "System Build (i.e Any Other)"
|
||||
survey = from_dict(PasHubRdSapSiteNotes, data)
|
||||
|
||||
# Act
|
||||
result = EpcPropertyDataMapper.from_site_notes(survey)
|
||||
|
||||
# Assert — code 6, but explicitly NOT a basement.
|
||||
part = result.sap_building_parts[0]
|
||||
assert part.wall_construction == 6
|
||||
assert part.main_wall_is_basement is False
|
||||
|
||||
|
||||
class TestCylinderSizeCoding:
|
||||
"""The surveyed §Water-Heating "Cylinder Size" label must resolve to the
|
||||
SAP10 cylinder-size enum (`_cylinder_volume_l_from_code` int-or-nones a raw
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue