Electric underfloor override stamps the Table 4a underfloor category (8) 🟥

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-03 11:35:55 +00:00
parent e110dd0746
commit 51fa497793

View file

@ -233,6 +233,32 @@ def test_off_peak_underfloor_asserts_a_dual_meter(main_heating_value: str) -> No
assert simulation.heating.meter_type == "Dual"
@pytest.mark.parametrize(
"main_heating_value",
[
"Electric underfloor, in concrete slab (off-peak)",
"Electric underfloor, integrated storage and direct-acting",
"Electric underfloor, in screed above insulation",
],
)
def test_electric_underfloor_overlays_the_underfloor_category(
main_heating_value: str,
) -> None:
# A system-replacing override must stamp the underfloor heating category
# (SAP Table 4a Category 8). Leaving it unset lets the replaced system's
# category survive onto the effective cert — property 711795's community
# heating (category 6) survived an underfloor override, so the heating
# generator read the dwelling as a heat network and offered no heating
# upgrade at all, and the baseline mis-rated 51 vs 67 (ADR-0050).
# Act
simulation = main_heating_overlay_for(main_heating_value, 0)
# Assert — SAP Table 4a Category 8 (Electric underfloor heating).
assert simulation is not None
assert simulation.heating is not None
assert simulation.heating.main_heating_category == 8
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