Detect block-level asset conditions 🟥

This commit is contained in:
Daniel Roth 2026-01-21 17:33:14 +00:00
parent ad03d11bc9
commit a07020d085
2 changed files with 36 additions and 1 deletions

View file

@ -19,4 +19,8 @@ class PeabodyAssetCondition:
cloned: str
lo_type_code: int
renewal_cost: Optional[float] = None
condition_survey_date: Optional[datetime] = None
condition_survey_date: Optional[datetime] = None
@property
def is_block_level(self) -> bool:
raise NotImplementedError

View file

@ -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