From 3dab6fc4251fa37e4367be844bd4f72a75806569 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 19 Jun 2026 12:24:31 +0000 Subject: [PATCH] =?UTF-8?q?Remap=20the=20EPC=20primary=20fuel=20from=20a?= =?UTF-8?q?=20landlord=20fuel=20override=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 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/domain/epc/test_main_fuel_overlay.py b/tests/domain/epc/test_main_fuel_overlay.py index 1b554f5b..2ffd9e29 100644 --- a/tests/domain/epc/test_main_fuel_overlay.py +++ b/tests/domain/epc/test_main_fuel_overlay.py @@ -9,6 +9,10 @@ from __future__ import annotations import pytest 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 ( + build_epc, +) def test_mains_gas_overlays_the_primary_fuel() -> None: @@ -59,3 +63,16 @@ def test_unresolvable_fuel_produces_no_overlay(main_fuel_value: str) -> None: # Assert assert simulation is None + + +def test_fuel_override_remaps_the_primary_systems_fuel_on_the_epc() -> None: + # Arrange — a landlord correction that the dwelling runs on electricity. + baseline = build_epc() + overlay = fuel_overlay_for("electricity", 0) + assert overlay is not None + + # Act + result = apply_simulations(baseline, [overlay]) + + # Assert — the calculator reads the primary fuel from main_heating_details[0]. + assert result.sap_heating.main_heating_details[0].main_fuel_type == 29