From 1e0d72a80537975aa06dc0006f04ca060f1b89b0 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 21 Apr 2026 11:47:35 +0000 Subject: [PATCH] =?UTF-8?q?extract=20secondary=20heating=20system=20?= =?UTF-8?q?=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../documents_parser/tests/test_extractor.py | 20 +++++++++++++++++++ .../epc/surveys/pashub_rdsap_site_notes.py | 1 + 2 files changed, 21 insertions(+) diff --git a/backend/documents_parser/tests/test_extractor.py b/backend/documents_parser/tests/test_extractor.py index 27214fd2..7e3c5160 100644 --- a/backend/documents_parser/tests/test_extractor.py +++ b/backend/documents_parser/tests/test_extractor.py @@ -402,6 +402,26 @@ class TestWaterHeatingCylinderThickness: assert hhw.water_heating.cylinder_size == "Normal (90-130 litres)" +class TestSecondaryHeating: + @pytest.fixture + def hhw(self) -> HeatingAndHotWater: + return PasHubRdSapSiteNotesExtractor( + load_text_fixture_2() + ).extract_heating_and_hot_water() + + @pytest.fixture + def hhw_no_secondary(self) -> HeatingAndHotWater: + return PasHubRdSapSiteNotesExtractor( + load_text_fixture() + ).extract_heating_and_hot_water() + + def test_secondary_system(self, hhw: HeatingAndHotWater) -> None: + assert hhw.secondary_heating.secondary_system == "Open fire in grate" + + def test_secondary_system_absent(self, hhw_no_secondary: HeatingAndHotWater) -> None: + assert hhw_no_secondary.secondary_heating.secondary_system is None + + class TestHeatingAndHotWater: @pytest.fixture def hhw(self) -> HeatingAndHotWater: diff --git a/datatypes/epc/surveys/pashub_rdsap_site_notes.py b/datatypes/epc/surveys/pashub_rdsap_site_notes.py index 31e189a5..1f46b613 100644 --- a/datatypes/epc/surveys/pashub_rdsap_site_notes.py +++ b/datatypes/epc/surveys/pashub_rdsap_site_notes.py @@ -179,6 +179,7 @@ class MainHeating: @dataclass class SecondaryHeating: secondary_fuel: str + secondary_system: Optional[str] = None @dataclass