mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
Recognise the pitched sloping-ceiling descriptions as roof types 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fc738fa843
commit
b8e9431292
1 changed files with 46 additions and 0 deletions
46
tests/domain/epc/test_roof_type.py
Normal file
46
tests/domain/epc/test_roof_type.py
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
"""Contract tests for the `RoofType` Landlord-Override taxonomy.
|
||||
|
||||
The `Pitched, sloping ceiling, …` family is lock-step with the app-side
|
||||
`RoofTypeValues` enum + Drizzle migration 0278 (assessment-model#449, ADR-0002 /
|
||||
ADR-0066): the string values here are the shared contract and must match
|
||||
byte-for-byte. The classifier resolves a reply value to a member via
|
||||
`RoofType(value)` (`ChatGptColumnClassifier._to_category`), so "is this a
|
||||
recognised roof type" is exactly the `RoofType(value)` construction below.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from domain.epc.property_overrides.roof_type import RoofType
|
||||
|
||||
# The pitched-sloping-ceiling family, byte-for-byte with assessment-model#449.
|
||||
_SLOPING_CEILING_VALUES: list[str] = [
|
||||
"Pitched, sloping ceiling, as built",
|
||||
"Pitched, sloping ceiling, 12 mm insulation",
|
||||
"Pitched, sloping ceiling, 25 mm insulation",
|
||||
"Pitched, sloping ceiling, 50 mm insulation",
|
||||
"Pitched, sloping ceiling, 75 mm insulation",
|
||||
"Pitched, sloping ceiling, 100 mm insulation",
|
||||
"Pitched, sloping ceiling, 125 mm insulation",
|
||||
"Pitched, sloping ceiling, 150 mm insulation",
|
||||
"Pitched, sloping ceiling, 175 mm insulation",
|
||||
"Pitched, sloping ceiling, 200 mm insulation",
|
||||
"Pitched, sloping ceiling, 225 mm insulation",
|
||||
"Pitched, sloping ceiling, 250 mm insulation",
|
||||
"Pitched, sloping ceiling, 270 mm insulation",
|
||||
"Pitched, sloping ceiling, 300 mm insulation",
|
||||
"Pitched, sloping ceiling, 350 mm insulation",
|
||||
"Pitched, sloping ceiling, 400 mm insulation",
|
||||
"Pitched, sloping ceiling, 400+ mm insulation",
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("value", _SLOPING_CEILING_VALUES)
|
||||
def test_pitched_sloping_ceiling_string_is_a_recognised_roof_type(value: str) -> None:
|
||||
# Act — the classifier resolves a canonical string through the enum
|
||||
# constructor; a missing member raises ValueError (falls to UNKNOWN).
|
||||
member = RoofType(value)
|
||||
|
||||
# Assert — the canonical string round-trips as its own member value.
|
||||
assert member.value == value
|
||||
Loading…
Add table
Reference in a new issue