mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
Preserve PasHub blank-Fuel electric-system inference through fuel-code normalization 🟪
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a8afcd1b3d
commit
b91763fc1d
1 changed files with 17 additions and 0 deletions
|
|
@ -842,3 +842,20 @@ class TestPasHubUnmappedMainFuel:
|
|||
# Act / Assert
|
||||
with pytest.raises(UnmappedPasHubLabel, match="Anthracite"):
|
||||
EpcPropertyDataMapper.from_site_notes(survey)
|
||||
|
||||
def test_blank_fuel_electric_system_resolves_to_electricity_code(self) -> None:
|
||||
# Arrange — an all-electric system whose surveyed Fuel cell is blank;
|
||||
# the existing electric-system inference must survive normalization and
|
||||
# emit the standard-electricity SAP fuel code (30), not the label.
|
||||
raw = load("pashub_rdsap_site_notes_example1.json")
|
||||
raw["heating_and_hot_water"]["main_heating"]["fuel"] = ""
|
||||
raw["heating_and_hot_water"]["main_heating"][
|
||||
"system_type"
|
||||
] = "Electric storage heaters"
|
||||
survey = from_dict(PasHubRdSapSiteNotes, raw)
|
||||
|
||||
# Act
|
||||
result = EpcPropertyDataMapper.from_site_notes(survey)
|
||||
|
||||
# Assert
|
||||
assert result.sap_heating.main_heating_details[0].main_fuel_type == 30
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue