From cab69bbca9209e582db110a93cf7f62d390e9f8b Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 19 Jun 2026 12:45:22 +0000 Subject: [PATCH] =?UTF-8?q?Guarantee=20every=20classifier=20fuel=20value?= =?UTF-8?q?=20maps=20to=20an=20overlay=20code=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/domain/epc/test_main_fuel_overlay.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/domain/epc/test_main_fuel_overlay.py b/tests/domain/epc/test_main_fuel_overlay.py index 2ffd9e29..6001ddc3 100644 --- a/tests/domain/epc/test_main_fuel_overlay.py +++ b/tests/domain/epc/test_main_fuel_overlay.py @@ -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 +