From 55ab5bfb80c90c75ce0022b88847dcfd9363cbdd Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 24 Jul 2026 09:10:14 +0000 Subject: [PATCH] =?UTF-8?q?Recognise=20the=20oil=20and=20solid-fuel=20boil?= =?UTF-8?q?er=20descriptions=20as=20heating=20systems=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- .../epc/test_main_heating_system_type.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/domain/epc/test_main_heating_system_type.py 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