mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Resolve a MIXED glazing override to no overlay, keeping the cert per-window glazing 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4e4a2d21c4
commit
f11fc9bc04
1 changed files with 18 additions and 2 deletions
|
|
@ -57,6 +57,18 @@ def test_unresolvable_glazing_produces_no_overlay(glazing_value: str) -> None:
|
|||
assert simulation is None
|
||||
|
||||
|
||||
def test_a_glazing_mix_produces_no_overlay_so_the_cert_is_kept() -> None:
|
||||
# A MIXED aggregate resolves to no overlay: a whole-dwelling proportion cannot
|
||||
# say which windows are which, so the cert's per-window `sap_windows` are kept
|
||||
# rather than flattened to one type (ADR-0042 amendment, #1376).
|
||||
|
||||
# Act
|
||||
simulation = glazing_overlay_for(GlazingType.MIXED.value, 0)
|
||||
|
||||
# Assert
|
||||
assert simulation is None
|
||||
|
||||
|
||||
def test_glazing_override_remaps_every_window_and_clears_lodged_u() -> None:
|
||||
# Arrange — baseline windows are double glazed (code 2, lodged U 2.8); the
|
||||
# landlord corrects the whole dwelling to single glazing.
|
||||
|
|
@ -74,14 +86,18 @@ def test_glazing_override_remaps_every_window_and_clears_lodged_u() -> None:
|
|||
assert all(w.window_transmission_details is None for w in result.sap_windows)
|
||||
|
||||
|
||||
_NO_OVERLAY_SENTINELS = {GlazingType.UNKNOWN, GlazingType.MIXED}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"member", [m for m in GlazingType if m is not GlazingType.UNKNOWN]
|
||||
"member", [m for m in GlazingType if m not in _NO_OVERLAY_SENTINELS]
|
||||
)
|
||||
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.
|
||||
# override silently no-ops. Every member except the deliberate no-overlay
|
||||
# sentinels (UNKNOWN, MIXED) must resolve to a code.
|
||||
|
||||
# Act
|
||||
simulation = glazing_overlay_for(member.value, 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue