mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Preserve an existing more-off-peak cert meter under a heating overlay 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6279924773
commit
e3c023e0f6
1 changed files with 29 additions and 0 deletions
|
|
@ -329,6 +329,35 @@ def test_the_three_heating_overrides_compose_without_conflict() -> None:
|
|||
assert result.sap_heating.water_heating_fuel == 29
|
||||
|
||||
|
||||
def test_room_heaters_preserve_an_existing_more_off_peak_cert_meter() -> None:
|
||||
# The overlay's assumed Dual (7-hour E7) meter is a coherent *default* for a
|
||||
# single/unknown-meter dwelling — it must NOT downgrade a cert that already
|
||||
# lodges a more-off-peak meter (here a 24-hour all-low tariff, code "4").
|
||||
# Clobbering it to E7 would bill the heating on a high/low split it doesn't
|
||||
# have, under-rating the dwelling.
|
||||
baseline = build_epc()
|
||||
baseline.sap_energy_source.meter_type = "4" # 24-hour tariff
|
||||
overlay = main_heating_overlay_for("Electric room heaters", 0)
|
||||
assert overlay is not None
|
||||
|
||||
result = apply_simulations(baseline, [overlay])
|
||||
|
||||
assert result.sap_energy_source.meter_type == "4"
|
||||
|
||||
|
||||
def test_room_heaters_set_dual_when_the_cert_meter_is_single() -> None:
|
||||
# The flip side: a single-rate dwelling DOES get the assumed Dual meter —
|
||||
# off-peak heating can't be billed on a single-rate meter (ADR-0035 drag).
|
||||
baseline = build_epc()
|
||||
baseline.sap_energy_source.meter_type = "Single"
|
||||
overlay = main_heating_overlay_for("Electric room heaters", 0)
|
||||
assert overlay is not None
|
||||
|
||||
result = apply_simulations(baseline, [overlay])
|
||||
|
||||
assert result.sap_energy_source.meter_type == "Dual"
|
||||
|
||||
|
||||
def test_electric_room_heaters_member_decodes_to_the_room_heater_code() -> None:
|
||||
# Arrange — the canonical landlord archetype for direct-acting room heaters
|
||||
member = MainHeatingSystemType.ELECTRIC_ROOM_HEATERS
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue