Decode single/double/triple glazing overrides to SAP codes 🟥

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jun-te Kim 2026-06-19 13:19:33 +00:00
parent 0fb86771dd
commit 917627c833

View file

@ -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