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 emitter label 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5b0f25847c
commit
64e31742b3
1 changed files with 22 additions and 0 deletions
|
|
@ -858,3 +858,25 @@ class TestPasHubUnmappedMainFuel:
|
|||
|
||||
# Assert
|
||||
assert result.sap_heating.main_heating_details[0].main_fuel_type == 30
|
||||
|
||||
|
||||
class TestPasHubUnmappedHeatEmitter:
|
||||
"""A PasHub survey whose surveyed main-heating emitter label the mapper does
|
||||
not yet cover must strict-raise `UnmappedPasHubLabel` at the boundary,
|
||||
naming the label — so a coverage gap is fixed here (a one-line lookup
|
||||
addition) rather than passed downstream as a raw string to resurface as the
|
||||
calculator's `UnmappedSapCode: heat_emitter_type`.
|
||||
"""
|
||||
|
||||
def test_unrecognised_emitter_label_raises_naming_the_label(self) -> None:
|
||||
# Arrange — an example fixture whose emitter cell carries a label the
|
||||
# Elmhurst emitter map does not cover.
|
||||
from datatypes.epc.domain.mapper import UnmappedPasHubLabel
|
||||
|
||||
raw = load("pashub_rdsap_site_notes_example1.json")
|
||||
raw["heating_and_hot_water"]["main_heating"]["emitter"] = "Skirting heaters"
|
||||
survey = from_dict(PasHubRdSapSiteNotes, raw)
|
||||
|
||||
# Act / Assert
|
||||
with pytest.raises(UnmappedPasHubLabel, match="Skirting heaters"):
|
||||
EpcPropertyDataMapper.from_site_notes(survey)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue