mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
Capture PAS Hub main-heating fuel from the colon 'Fuel:' label variant 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7072499b2e
commit
2783c2c0c6
1 changed files with 38 additions and 0 deletions
|
|
@ -537,6 +537,44 @@ class TestHeatingAndHotWater:
|
|||
)
|
||||
|
||||
|
||||
class TestMainHeatingFuelLabelVariant:
|
||||
"""The newer PAS Hub site-note form lodges the main-heating fuel under a
|
||||
`Fuel:` label (with colon) rather than the usual `Fuel`. The extractor must
|
||||
recognise both, else the fuel is silently dropped and the property presents
|
||||
as fuel-less downstream — the 3 Guinness cohort "blank-fuel" residuals that
|
||||
were really Mains Gas all along (issue #1558)."""
|
||||
|
||||
def _section(self, fuel_label: str) -> list[str]:
|
||||
return [
|
||||
"Heating & Hot Water",
|
||||
"System type:",
|
||||
"Boiler with radiators or underfloor heating",
|
||||
fuel_label,
|
||||
"Mains Gas",
|
||||
"Ventilation",
|
||||
]
|
||||
|
||||
def test_colon_fuel_label_captures_value(self) -> None:
|
||||
# Arrange
|
||||
tokens = self._section("Fuel:")
|
||||
|
||||
# Act
|
||||
hhw = PasHubRdSapSiteNotesExtractor(tokens).extract_heating_and_hot_water()
|
||||
|
||||
# Assert
|
||||
assert hhw.main_heating.fuel == "Mains Gas"
|
||||
|
||||
def test_plain_fuel_label_still_captures_value(self) -> None:
|
||||
# Arrange
|
||||
tokens = self._section("Fuel")
|
||||
|
||||
# Act
|
||||
hhw = PasHubRdSapSiteNotesExtractor(tokens).extract_heating_and_hot_water()
|
||||
|
||||
# Assert
|
||||
assert hhw.main_heating.fuel == "Mains Gas"
|
||||
|
||||
|
||||
class TestVentilation:
|
||||
@pytest.fixture
|
||||
def ventilation(self) -> Ventilation:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue