mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Guarantee every classifier fuel value maps to an overlay code 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
dbfe9820a5
commit
cab69bbca9
1 changed files with 16 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from domain.epc.main_fuel_type import MainFuelType
|
||||||
from domain.epc.property_overlays.main_fuel_overlay import fuel_overlay_for
|
from domain.epc.property_overlays.main_fuel_overlay import fuel_overlay_for
|
||||||
from domain.modelling.scoring.overlay_applicator import apply_simulations
|
from domain.modelling.scoring.overlay_applicator import apply_simulations
|
||||||
from tests.domain.sap10_calculator.worksheet._elmhurst_worksheet_000490 import (
|
from tests.domain.sap10_calculator.worksheet._elmhurst_worksheet_000490 import (
|
||||||
|
|
@ -76,3 +77,18 @@ def test_fuel_override_remaps_the_primary_systems_fuel_on_the_epc() -> None:
|
||||||
|
|
||||||
# Assert — the calculator reads the primary fuel from main_heating_details[0].
|
# Assert — the calculator reads the primary fuel from main_heating_details[0].
|
||||||
assert result.sap_heating.main_heating_details[0].main_fuel_type == 29
|
assert result.sap_heating.main_heating_details[0].main_fuel_type == 29
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
"member", [m for m in MainFuelType if m is not MainFuelType.UNKNOWN]
|
||||||
|
)
|
||||||
|
def test_every_resolvable_fuel_value_decodes_to_a_code(member: MainFuelType) -> None:
|
||||||
|
# A classifier emits a MainFuelType value; if the overlay can't decode it the
|
||||||
|
# override silently no-ops. Every non-UNKNOWN member must resolve.
|
||||||
|
|
||||||
|
# Act
|
||||||
|
simulation = fuel_overlay_for(member.value, 0)
|
||||||
|
|
||||||
|
# Assert
|
||||||
|
assert simulation is not None
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue