mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Guarantee every classifier glazing value maps to an overlay code 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
db95205fc5
commit
5a6d9a4e5d
1 changed files with 17 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ from __future__ import annotations
|
|||
|
||||
import pytest
|
||||
|
||||
from domain.epc.glazing_type import GlazingType
|
||||
from domain.epc.property_overlays.glazing_overlay import glazing_overlay_for
|
||||
from domain.modelling.scoring.overlay_applicator import apply_simulations
|
||||
from tests.domain.sap10_calculator.worksheet._elmhurst_worksheet_000490 import (
|
||||
|
|
@ -71,3 +72,19 @@ def test_glazing_override_remaps_every_window_and_clears_lodged_u() -> None:
|
|||
# U is cleared so the Table-24 cascade re-derives U from the new type.
|
||||
assert all(w.glazing_type == 1 for w in result.sap_windows)
|
||||
assert all(w.window_transmission_details is None for w in result.sap_windows)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"member", [m for m in GlazingType if m is not GlazingType.UNKNOWN]
|
||||
)
|
||||
def test_every_resolvable_glazing_value_decodes_to_a_code(
|
||||
member: GlazingType,
|
||||
) -> None:
|
||||
# A classifier emits a GlazingType value; if the overlay can't decode it the
|
||||
# override silently no-ops. Every non-UNKNOWN member must resolve.
|
||||
|
||||
# Act
|
||||
simulation = glazing_overlay_for(member.value, 0)
|
||||
|
||||
# Assert
|
||||
assert simulation is not None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue