mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
"""The composed roof guard wired into the roof `GuardedColumnClassifier`.
|
|
|
|
Two deterministic roof guards compose ahead of the LLM fallback: the
|
|
party-ceiling guard (#1376) and the sloping-ceiling guard (ADR-0066). A roof
|
|
description that neither recognises returns None and reaches the LLM.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from domain.epc.property_overrides.roof_guard import roof_guard
|
|
from domain.epc.property_overrides.roof_type import RoofType
|
|
|
|
|
|
def test_party_ceiling_marker_resolves_to_its_party_member() -> None:
|
|
# Act
|
|
member = roof_guard("another dwelling above")
|
|
|
|
# Assert
|
|
assert member is RoofType.ADJACENT_ANOTHER_DWELLING_ABOVE
|
|
|
|
|
|
def test_sloping_ceiling_marker_resolves_to_the_sloping_family() -> None:
|
|
# Act
|
|
member = roof_guard("PitchedWithSlopingCeiling: 150mm")
|
|
|
|
# Assert
|
|
assert member is RoofType.PITCHED_SLOPING_CEILING_150MM
|
|
|
|
|
|
def test_a_plain_loft_description_is_left_for_the_llm() -> None:
|
|
# Neither deterministic guard recognises a loft depth, so it reaches the LLM.
|
|
|
|
# Act
|
|
member = roof_guard("Pitched, 150 mm loft insulation")
|
|
|
|
# Assert
|
|
assert member is None
|