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:
Jun-te Kim 2026-06-19 12:45:22 +00:00
parent dbfe9820a5
commit cab69bbca9

View file

@ -8,6 +8,7 @@ from __future__ import annotations
import pytest
from domain.epc.main_fuel_type import MainFuelType
from domain.epc.property_overlays.main_fuel_overlay import fuel_overlay_for
from domain.modelling.scoring.overlay_applicator import apply_simulations
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 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