Remap the EPC primary fuel from a landlord fuel override 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jun-te Kim 2026-06-19 12:24:31 +00:00
parent b85db926ed
commit 3dab6fc425

View file

@ -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