diff --git a/tests/domain/epc/test_main_heating_system_type.py b/tests/domain/epc/test_main_heating_system_type.py new file mode 100644 index 000000000..b206b672b --- /dev/null +++ b/tests/domain/epc/test_main_heating_system_type.py @@ -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