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