From 7f8e2762d0487986df9ebdbfeac6e491d681eaaf Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 19 Jun 2026 12:22:32 +0000 Subject: [PATCH] =?UTF-8?q?Decode=20landlord=20electricity/LPG/oil/coal=20?= =?UTF-8?q?overrides=20to=20fuel=20codes=20=F0=9F=9F=A5?= 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 | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/domain/epc/test_main_fuel_overlay.py b/tests/domain/epc/test_main_fuel_overlay.py index 96072c1d..f3cf0007 100644 --- a/tests/domain/epc/test_main_fuel_overlay.py +++ b/tests/domain/epc/test_main_fuel_overlay.py @@ -6,6 +6,8 @@ reads from the dwelling's primary heating system; the overlay is whole-dwelling. from __future__ import annotations +import pytest + from domain.epc.property_overlays.main_fuel_overlay import fuel_overlay_for @@ -17,3 +19,24 @@ def test_mains_gas_overlays_the_primary_fuel() -> None: assert simulation is not None assert simulation.heating is not None assert simulation.heating.main_fuel_type == 26 + + +@pytest.mark.parametrize( + ("main_fuel_value", "code"), + [ + ("electricity", 29), + ("LPG (bulk)", 27), + ("oil", 28), + ("house coal", 33), + ], +) +def test_fuels_decode_to_their_modern_not_community_codes( + main_fuel_value: str, code: int +) -> None: + # Act + simulation = fuel_overlay_for(main_fuel_value, 0) + + # Assert + assert simulation is not None + assert simulation.heating is not None + assert simulation.heating.main_fuel_type == code