diff --git a/tests/domain/modelling/test_solar_config_selection.py b/tests/domain/modelling/test_solar_config_selection.py index 01dba8533..eb4f7f757 100644 --- a/tests/domain/modelling/test_solar_config_selection.py +++ b/tests/domain/modelling/test_solar_config_selection.py @@ -373,3 +373,20 @@ def test_roof_capped_below_two_panels_still_yields_no_configs() -> None: # Assert assert configs == () + + +def test_dwelling_roof_cap_bounds_the_sub_ladder_too() -> None: + # ADR-0058 — the cap regime is unchanged: when the Dwelling-Roof Cap + # (ADR-0038) resolves BELOW the 0.7×Google cap, it bounds the Sub-Ladder + # rungs as well — a conflated Google roof can't inflate even a small array. + + # Arrange — max 6 (0.7 cap = 4.2) with Google's ladder starting at 4; + # a ~8.5 m² dwelling roof caps at ≈2.5 panels → only the 2-panel rung. + potential = _potential_with_panel_dims(max_panels=6, panel_counts=(4,)) + + # Act + configs = select_conservative_configs(potential, dwelling_roof_area_m2=8.5) + + # Assert — one rung at 2 panels, pro-rata off the 4-panel rung's 400. + assert [c.panels_count for c in configs] == [2] + assert [c.yearly_energy_dc_kwh for c in configs] == [200.0]