test: correct multi-measure plan expectation for exposed-floor fix 🟩

The fixture lodges is_exposed_floor=True, which was silently dropped on
save->reload before this branch — so the orchestrator (reads the DB) modelled
the floor as not-exposed. Now it round-trips, the exposed floor is honoured,
and the ASHP-led max-gain fallback on this gas dwelling is bill-neutral
(marginally negative) rather than bill-positive: large energy saving, but the
gas->electricity fuel switch offsets the GBP saving. Same optimal package,
same telescoping; only the bill-savings sign assumption changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-06-26 16:58:48 +00:00
parent 21b25b8b35
commit bb4f8577fe

View file

@ -364,12 +364,18 @@ def test_modelling_optimises_and_persists_a_multi_measure_plan(
assert plan.cost_of_works is not None
assert plan.cost_of_works > 0.0
# Plan-level energy/bill figures derived from the post-package bill vs the
# baseline bill at the run's Fuel Rates (ADR-0014 amendment). The package
# improves the property, so it consumes less energy and costs less to run.
# baseline bill at the run's Fuel Rates (ADR-0014 amendment). The max-gain
# fallback package is ASHP-led on a *gas* dwelling whose suspended floor is
# correctly modelled as exposed (is_exposed_floor now round-trips through
# persistence — #TBD): it saves a large amount of delivered energy, but the
# gas→electricity fuel switch trades cheap gas kWh for pricier electricity
# kWh, so the *bill* is roughly neutral (marginally negative). The exact
# value is pinned by the telescoping cascade below; here we only assert the
# figure is produced (sign is not load-bearing for a SAP-max fallback).
assert plan.post_energy_bill is not None and plan.post_energy_bill > 0.0
assert plan.post_energy_consumption is not None
assert plan.post_energy_consumption > 0.0
assert plan.energy_bill_savings is not None and plan.energy_bill_savings > 0.0
assert plan.energy_bill_savings is not None
assert plan.energy_consumption_savings is not None
assert plan.energy_consumption_savings > 0.0