From 787f0066c8b0b5548c91c74f3821313a686ad699 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Thu, 2 Jul 2026 11:09:47 +0000 Subject: [PATCH] =?UTF-8?q?Dominant=20secondary-glazing=20split=20resolves?= =?UTF-8?q?=20deterministically=20to=20SECONDARY=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- tests/domain/epc/test_glazing_mix_guard.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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