Defer the screed-underfloor meter to the cert while off-peak underfloor asserts Dual 🟥

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-01 16:36:59 +00:00
parent 749ac3a5ff
commit 1c79b69648

View file

@ -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"),
[