diff --git a/tests/harness/test_console.py b/tests/harness/test_console.py index 5712a62c..fb7c1c07 100644 --- a/tests/harness/test_console.py +++ b/tests/harness/test_console.py @@ -70,7 +70,7 @@ def test_run_one_returns_a_plan_and_prints_the_table( assert len(plan.measures) >= 1 printed: str = capsys.readouterr().out assert "Plan SAP" in printed - assert "cavity_wall_insulation" in printed + assert "air_source_heat_pump" in printed def test_run_modelling_inspects_a_plan_without_baseline_or_lodged_performance() -> None: diff --git a/tests/harness/test_report.py b/tests/harness/test_report.py index af020aee..6b8bc9a4 100644 --- a/tests/harness/test_report.py +++ b/tests/harness/test_report.py @@ -80,35 +80,28 @@ def test_each_fired_measure_carries_the_attributes_that_triggered_it() -> None: # Assert — the Plan ran and every fired measure names its trigger fields. assert report.plan is not None assert report.plan_error is None - # This gas dwelling lodges an electric secondary heater (SAP 691) on a - # category-2 main, so secondary-heating removal (ADR-0028) is a very cheap - # SAP lever (\£250); the Optimiser reaches the target band via the fabric - # stack + that removal, leaving the \£12k ASHP unselected (it owns the - # economics — ADR-0024). + # The gain-maximising package: the efficient representative ASHP (ADR-0025) + # plus solid-floor insulation. The cavity wall + its forced mechanical + # ventilation (ADR-0016) are NOT selected — the wall earns +SAP alone but + # the forced-ventilation penalty makes the pair net-negative, so the + # Optimiser correctly leaves them out (see test_measure_dependency / + # test_optimiser for the forced-edge unit coverage; cavity_wall + + # mechanical_ventilation trigger fields are exercised in + # test_cavity_wall_recommendation / the ventilation generator tests). triggers: dict[str, MeasureTrigger] = _triggers_by_measure(report) assert set(triggers) == { - "cavity_wall_insulation", - "mechanical_ventilation", "solid_floor_insulation", - "secondary_heating_removal", - } - # Cavity-fill fired off an uninsulated cavity wall; its dependent MEV fired - # because no mechanical ventilation is lodged. - assert triggers["cavity_wall_insulation"].triggers == { - "wall_construction": 4, - "wall_insulation_type": 4, - } - assert triggers["mechanical_ventilation"].triggers == { - "mechanical_ventilation_kind": None, + "air_source_heat_pump", } # Solid-floor insulation fired off an uninsulated solid ground floor. assert triggers["solid_floor_insulation"].triggers == { "floor_insulation_thickness": None, "floor_construction_type": "Solid", } - # Secondary-heating removal fired off the lodged secondary (SAP code 691). - assert triggers["secondary_heating_removal"].triggers == { - "secondary_heating_type": 691, + # The ASHP bundle fired off the gas-dwelling main it replaces. + assert triggers["air_source_heat_pump"].triggers == { + "property_type": "0", + "main_heating_category": 2, } @@ -174,18 +167,20 @@ def test_few_measure_cert_surfaces_only_its_fired_measures_triggers() -> None: # Act report: PropertyReport = build_property_report(path) - # Assert — 0036 reaches the target band with solid-floor insulation plus - # secondary-heating removal (it lodges an electric secondary, SAP 691, on a - # gas main — a cheap SAP lever, ADR-0028), and nothing else. The cheaper-to- - # target pair displaces the LED upgrade the Optimiser used to add. + # Assert — 0036's gain-maximising package is solid-floor insulation plus the + # low-energy-lighting upgrade (it lodges 7 low-energy + 0 incandescent fixed + # bulbs, so the LED top-up is a cheap positive-SAP lever, ADR-0023), and + # nothing else. triggers: dict[str, MeasureTrigger] = _triggers_by_measure(report) - assert set(triggers) == {"solid_floor_insulation", "secondary_heating_removal"} + assert set(triggers) == {"solid_floor_insulation", "low_energy_lighting"} assert triggers["solid_floor_insulation"].triggers == { "floor_insulation_thickness": None, "floor_construction_type": "Solid", } - assert triggers["secondary_heating_removal"].triggers == { - "secondary_heating_type": 691, + assert triggers["low_energy_lighting"].triggers == { + "incandescent_fixed_lighting_bulbs_count": 0, + "cfl_fixed_lighting_bulbs_count": None, + "low_energy_fixed_lighting_bulbs_count": 7, }