mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
Recognise the oil and solid-fuel boiler descriptions as heating systems 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e0478cfa5d
commit
55ab5bfb80
1 changed files with 33 additions and 0 deletions
33
tests/domain/epc/test_main_heating_system_type.py
Normal file
33
tests/domain/epc/test_main_heating_system_type.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
"""Contract tests for the `MainHeatingSystemType` Landlord-Override taxonomy.
|
||||
|
||||
The oil / solid-fuel boiler family is lock-step with the app-side
|
||||
`MainHeatingSystemValues` enum + migration 0279 (assessment-model#455, ADR-0002 /
|
||||
ADR-0067): the string values here are the shared contract and must match
|
||||
byte-for-byte. The classifier resolves a reply value to a member via
|
||||
`MainHeatingSystemType(value)`, so "is this a recognised system" is exactly that
|
||||
construction.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from domain.epc.property_overrides.main_heating_system_type import (
|
||||
MainHeatingSystemType,
|
||||
)
|
||||
|
||||
# The oil / solid-fuel boiler family, byte-for-byte with assessment-model#455.
|
||||
_BOILER_VALUES: list[str] = [
|
||||
"Oil boiler, regular",
|
||||
"Oil boiler, combi",
|
||||
"Solid fuel boiler",
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("value", _BOILER_VALUES)
|
||||
def test_oil_and_solid_fuel_boiler_string_is_a_recognised_system(value: str) -> None:
|
||||
# Act — a missing member raises ValueError (the classifier falls to UNKNOWN).
|
||||
member = MainHeatingSystemType(value)
|
||||
|
||||
# Assert — the canonical string round-trips as its own member value.
|
||||
assert member.value == value
|
||||
Loading…
Add table
Reference in a new issue