From 917627c8336151bb8525ca32f9aba5b57810d90c Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 19 Jun 2026 13:19:33 +0000 Subject: [PATCH] =?UTF-8?q?Decode=20single/double/triple=20glazing=20overr?= =?UTF-8?q?ides=20to=20SAP=20codes=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/domain/epc/test_glazing_overlay.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/domain/epc/test_glazing_overlay.py b/tests/domain/epc/test_glazing_overlay.py index b54e134e..a5a6699e 100644 --- a/tests/domain/epc/test_glazing_overlay.py +++ b/tests/domain/epc/test_glazing_overlay.py @@ -7,6 +7,8 @@ window by `_fold_glazing`). from __future__ import annotations +import pytest + from domain.epc.property_overlays.glazing_overlay import glazing_overlay_for @@ -18,3 +20,24 @@ def test_double_glazing_post_2002_overlays_its_glazing_code() -> None: assert simulation is not None assert simulation.glazing is not None assert simulation.glazing.glazing_type == 2 + + +@pytest.mark.parametrize( + ("glazing_value", "code"), + [ + ("Single glazing", 1), + ("Double glazing, pre-2002", 3), + ("Triple glazing, 2002 or later", 9), + ("Triple glazing, pre-2002", 6), + ], +) +def test_glazing_types_decode_to_their_sap_codes( + glazing_value: str, code: int +) -> None: + # Act + simulation = glazing_overlay_for(glazing_value, 0) + + # Assert + assert simulation is not None + assert simulation.glazing is not None + assert simulation.glazing.glazing_type == code