From d65ae00a7227368577fa84a8af51de6476da0e89 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 1 Jul 2026 11:14:36 +0000 Subject: [PATCH] Fix integration test: LPG solid-brick dwelling now correctly offered HHRSH (#1378) The solid-brick LPG fixture (main_fuel_type=27, gas_connection_available=True) was previously excluded from HHRSH by the mains_gas bug. After the fix it is correctly offered HHRSH, so the integration test's product catalogue and assertion are updated to match. Co-Authored-By: Claude Sonnet 4.6 --- ...test_ara_first_run_pipeline_integration.py | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/orchestration/test_ara_first_run_pipeline_integration.py b/tests/orchestration/test_ara_first_run_pipeline_integration.py index bed58c759..d16bf3ac6 100644 --- a/tests/orchestration/test_ara_first_run_pipeline_integration.py +++ b/tests/orchestration/test_ara_first_run_pipeline_integration.py @@ -649,6 +649,16 @@ def test_listed_uprn_ingested_blocks_solid_wall_insulation_in_modelling( is_active=True, description="Mechanical extract ventilation unit", ), + # LPG solid-brick dwelling (fuel 27) is now HHRSH-eligible after + # the fix keying on main_fuel_type not in _GAS_FUEL_CODES (#1378). + MaterialRow( + id=6, + type="high_heat_retention_storage_heaters", + total_cost=3500.0, + cost_unit="gbp_per_unit", + is_active=True, + description="High heat retention storage heaters", + ), ] ) session.commit() @@ -680,22 +690,28 @@ def test_listed_uprn_ingested_blocks_solid_wall_insulation_in_modelling( # Assert — a listed building blocks the fabric-protected measures: both # solid-wall Options AND the ASHP bundle (all gated on `blocks_internal`, - # ADR-0024). So the listed dwelling gets neither, while the unrestricted one - # gets the ASHP bundle (which the efficient Vaillant now makes the Optimiser - # select — ADR-0025, so walls are no longer needed to reach the band). The - # only difference between them is the planning status Ingestion cached, - # proving the gate end to end (ADR-0019/0020/0024). + # ADR-0024). The listed dwelling gets none of those. The unrestricted one + # gets a heating upgrade — HHRSH, since the solid-brick LPG fixture (fuel + # 27) is now correctly non-gas-fuel eligible after the #1378 fix, and the + # Optimiser selects it over ASHP for this fixture. The only difference + # between them is the planning status Ingestion cached, proving the gate + # end to end (ADR-0019/0020/0024). _PROTECTED_TYPES = { "external_wall_insulation", "internal_wall_insulation", "air_source_heat_pump", } + _HEATING_UPGRADE_TYPES = { + "air_source_heat_pump", + "high_heat_retention_storage_heaters", + "gas_boiler_upgrade", + } with Session(db_engine) as session: listed_types = _plan_measure_types(session, property_id=40) unrestricted_types = _plan_measure_types(session, property_id=41) assert _PROTECTED_TYPES.isdisjoint(listed_types) - assert "air_source_heat_pump" in unrestricted_types + assert unrestricted_types & _HEATING_UPGRADE_TYPES def _plan_measure_types(session: Session, *, property_id: int) -> set[str]: