mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
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:
parent
0fb86771dd
commit
917627c833
1 changed files with 23 additions and 0 deletions
|
|
@ -7,6 +7,8 @@ window by `_fold_glazing`).
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from domain.epc.property_overlays.glazing_overlay import glazing_overlay_for
|
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 is not None
|
||||||
assert simulation.glazing is not None
|
assert simulation.glazing is not None
|
||||||
assert simulation.glazing.glazing_type == 2
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue