diff --git a/tests/domain/epc/test_glazing_mix_guard.py b/tests/domain/epc/test_glazing_mix_guard.py index 973b96b6a..04e351cd3 100644 --- a/tests/domain/epc/test_glazing_mix_guard.py +++ b/tests/domain/epc/test_glazing_mix_guard.py @@ -1,5 +1,7 @@ from __future__ import annotations +import pytest + from domain.epc.property_overrides.glazing_type import GlazingType from domain.epc.property_overrides.glazing_mix_guard import glazing_mix_guard @@ -14,3 +16,24 @@ def test_a_genuine_percentage_mix_classifies_as_mixed() -> None: # Assert — a mix defers to the cert's per-window glazing, not a whole-dwelling # type. assert result is GlazingType.MIXED + + +@pytest.mark.parametrize( + "description", + [ + "100% double glazing 2002 or later", # uniform — one type + "96% double glazing 2002 or later, 4% single glazing", # >= 90% -> uniform + "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 + "", + ], +) +def test_uniform_or_unparseable_glazing_defers_to_the_llm(description: str) -> None: + # The guard only claims a genuine percentage mix; a uniform assertion (applied + # as that type) or a varied phrasing is left for the LLM classifier. + + # Act + result = glazing_mix_guard(description) + + # Assert + assert result is None