From da15418fd897f94cc4f4b469dfdc1987b38e2a42 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 1 Jul 2026 13:02:38 +0000 Subject: [PATCH] =?UTF-8?q?Resolve=20biomass,=20dual-fuel=20and=20biodiese?= =?UTF-8?q?l=20water-heating=20overrides=20off=20house=20coal=20?= =?UTF-8?q?=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) --- .../domain/epc/test_water_heating_overlay.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/domain/epc/test_water_heating_overlay.py b/tests/domain/epc/test_water_heating_overlay.py index 58ba813f7..f71ddcee4 100644 --- a/tests/domain/epc/test_water_heating_overlay.py +++ b/tests/domain/epc/test_water_heating_overlay.py @@ -86,6 +86,33 @@ def test_from_main_wood_logs_decodes_to_the_wood_fuel_not_house_coal() -> None: assert simulation.heating.water_heating_fuel == 6 +@pytest.mark.parametrize( + ("water_heating_value", "fuel"), + [ + # Biomass (community) — RdSAP fuel 31. Under a coherent community main + # the calculator scores DHW from the main, so this is a faithful, + # score-neutral relabel off house coal; the fuel is still emitted so an + # individual-main dwelling would score biomass, not coal (ADR-0043). + ("From main system, biomass (community)", 31), + # Dual fuel (mineral + wood) — RdSAP fuel 9. + ("From main system, dual fuel (mineral and wood)", 9), + # Biodiesel (community) — RdSAP fuel 34. + ("From main system, biodiesel (community)", 34), + ], +) +def test_biomass_family_water_heating_decodes_off_house_coal( + water_heating_value: str, fuel: int +) -> None: + # Act + simulation = water_heating_overlay_for(water_heating_value, 0) + + # Assert — from main system (901), each to its own RdSAP fuel, not coal 33. + assert simulation is not None + assert simulation.heating is not None + assert simulation.heating.water_heating_code == 901 + assert simulation.heating.water_heating_fuel == fuel + + @pytest.mark.parametrize("water_heating_value", ["Unknown", ""]) def test_unresolvable_water_heating_produces_no_overlay( water_heating_value: str,