From a07020d085d2517737624dd24d42bba37316e1f3 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 21 Jan 2026 17:33:14 +0000 Subject: [PATCH] =?UTF-8?q?Detect=20block-level=20asset=20conditions=20?= =?UTF-8?q?=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../peabody/peabody_asset_condition.py | 6 +++- .../tests/parsing/test_peabody_parser.py | 31 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/backend/condition/parsing/records/peabody/peabody_asset_condition.py b/backend/condition/parsing/records/peabody/peabody_asset_condition.py index a82e87f1..5451d570 100644 --- a/backend/condition/parsing/records/peabody/peabody_asset_condition.py +++ b/backend/condition/parsing/records/peabody/peabody_asset_condition.py @@ -19,4 +19,8 @@ class PeabodyAssetCondition: cloned: str lo_type_code: int renewal_cost: Optional[float] = None - condition_survey_date: Optional[datetime] = None \ No newline at end of file + condition_survey_date: Optional[datetime] = None + + @property + def is_block_level(self) -> bool: + raise NotImplementedError \ No newline at end of file diff --git a/backend/condition/tests/parsing/test_peabody_parser.py b/backend/condition/tests/parsing/test_peabody_parser.py index 5196e65d..830e8f2c 100644 --- a/backend/condition/tests/parsing/test_peabody_parser.py +++ b/backend/condition/tests/parsing/test_peabody_parser.py @@ -122,3 +122,34 @@ def test_peabody_parser_parses_conditions(peabody_assets_xlsx_bytes): assert len(result) == 3 assert all(isinstance(item, PeabodyProperty) for item in result) + +def test_peabody_asset_is_block_level(): + # arrange + asset_condition = PeabodyAssetCondition( + lo_reference="", + full_address="1-80 PRINCESS ALICE HOUSE LONDON", + location_type_code=0, + parent_lo_reference="", + element_code=0, + element="", + sub_element_code=0, + sub_element="", + material_code=0, + material_or_answer="", + renewal_quantity=0, + renewal_year=2026, + cloned="", + lo_type_code=0, + renewal_cost=None, + condition_survey_date=None + ) + + expected_block_level = True + + # act + actual_block_level = asset_condition.is_block_level + + # assert + assert expected_block_level == actual_block_level + + \ No newline at end of file