diff --git a/tests/domain/epc/test_glazing_mix_guard.py b/tests/domain/epc/test_glazing_mix_guard.py index de1faccf0..8d6e349cd 100644 --- a/tests/domain/epc/test_glazing_mix_guard.py +++ b/tests/domain/epc/test_glazing_mix_guard.py @@ -63,10 +63,31 @@ def test_dominant_era_stated_double_or_triple_resolves_deterministically( assert result is expected +@pytest.mark.parametrize( + "description", + [ + "95% secondary glazing (sap 9.94), 5% single glazing", + "90% secondary glazing, 10% double glazing 2002 or later", + ], +) +def test_dominant_secondary_glazing_resolves_to_secondary(description: str) -> None: + # Secondary glazing is era-free like single (SAP10 code 5, U = 2.9 regardless + # of install year), so a dominant-secondary split is fully determined — the + # guard must claim it rather than let the LLM flatten it onto the minority + # type (Model#1416). + + # Act + result = glazing_mix_guard(description) + + # Assert + assert result is GlazingType.SECONDARY + + @pytest.mark.parametrize( "description", [ "100% double glazing 2002 or later", # uniform — one type + "100% secondary glazing (sap 9.94)", # uniform — one type "90% double glazing unknown age, 10% single glazing", # dominant but era unstated "80% double glazing 2002 or later, 20% double glazing pre-2002", # same base type "some double glazing and a bit of single", # unparseable — no percentages