mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
Strict-raise on an unrecognised PasHub main-heating control label 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
be076bb9a4
commit
168c610ade
1 changed files with 20 additions and 0 deletions
|
|
@ -926,3 +926,23 @@ class TestPasHubMainHeatingControlCoding:
|
|||
|
||||
# Act / Assert
|
||||
assert _control_type(main) == control_type
|
||||
|
||||
def test_unrecognised_control_label_raises_naming_the_label(self) -> None:
|
||||
# Arrange — a Controls label the boiler table does not cover (e.g. the
|
||||
# cohort's lone community-charging control). It must strict-raise
|
||||
# `UnmappedPasHubLabel` at the boundary, naming the label, so the gap is
|
||||
# a one-line lookup addition here rather than a raw string resurfacing
|
||||
# as the calculator's `UnmappedSapCode`.
|
||||
from datatypes.epc.domain.mapper import UnmappedPasHubLabel
|
||||
|
||||
raw = load("pashub_rdsap_site_notes_example1.json")
|
||||
raw["heating_and_hot_water"]["main_heating"][
|
||||
"controls"
|
||||
] = "Charging system linked to use of community heating"
|
||||
survey = from_dict(PasHubRdSapSiteNotes, raw)
|
||||
|
||||
# Act / Assert
|
||||
with pytest.raises(
|
||||
UnmappedPasHubLabel, match="Charging system linked to use of community"
|
||||
):
|
||||
EpcPropertyDataMapper.from_site_notes(survey)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue