From 1c79b69648c0500cc04173ec6fc7e854f6fb362e Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 1 Jul 2026 16:36:59 +0000 Subject: [PATCH] =?UTF-8?q?Defer=20the=20screed-underfloor=20meter=20to=20?= =?UTF-8?q?the=20cert=20while=20off-peak=20underfloor=20asserts=20Dual=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) --- .../epc/test_main_heating_system_overlay.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/domain/epc/test_main_heating_system_overlay.py b/tests/domain/epc/test_main_heating_system_overlay.py index ad6944255..c477bcee2 100644 --- a/tests/domain/epc/test_main_heating_system_overlay.py +++ b/tests/domain/epc/test_main_heating_system_overlay.py @@ -150,6 +150,37 @@ def test_electric_underfloor_decodes_to_its_own_code_dragging_electricity( assert simulation.heating.main_fuel_type == 29 +@pytest.mark.parametrize( + "main_heating_value", + [ + # "off-peak only" / "off peak" positively claim off-peak. + "Electric underfloor, in concrete slab (off-peak)", + "Electric underfloor, integrated storage and direct-acting", + ], +) +def test_off_peak_underfloor_asserts_a_dual_meter(main_heating_value: str) -> None: + # Act + simulation = main_heating_overlay_for(main_heating_value, 0) + + # Assert — an off-peak underfloor must not bill overnight heat at the peak rate. + assert simulation is not None + assert simulation.heating is not None + assert simulation.heating.meter_type == "Dual" + + +def test_screed_underfloor_defers_the_meter_to_the_cert() -> None: + # "In screed above insulation (standard or off peak)" is tariff-ambiguous (81% + # of the corpus lodge off-peak), so the archetype cannot know the meter — it + # leaves meter_type unset so the cert's lodged meter stands (ADR-0046). + simulation = main_heating_overlay_for( + "Electric underfloor, in screed above insulation", 0 + ) + + assert simulation is not None + assert simulation.heating is not None + assert simulation.heating.meter_type is None + + @pytest.mark.parametrize( ("main_heating_value", "code"), [