Model/tests/condition/test_load_report.py
Khalim Conn-Kowlessar 87eecc6400 Summarise a Calico load as a four-count reconciliation report 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 15:09:39 +00:00

38 lines
1.1 KiB
Python

from applications.condition.load_report import LoadReport
from domain.condition.records.calico.calico_asset_condition import CalicoAssetCondition
from domain.condition.records.calico.calico_property import CalicoProperty
def _property(uprn: int, reference: int, covering: str) -> CalicoProperty:
return CalicoProperty(
uprn=uprn,
assets=[
CalicoAssetCondition(
asset_reference=reference, path="Roof Covering", covering_type=covering
)
],
)
def test_load_report_summarises_the_four_reconciliation_counts():
# Arrange
properties = [
_property(100093305101, 443, "Concrete Tiles"),
_property(100093388053, 444, "Natural Slate"),
]
# Act
report = LoadReport.from_calico_load(
properties=properties,
blank_placeholder_count=1239,
unmatched_reference_count=5,
null_uprn_references=["999", "888"],
)
# Assert
assert report == LoadReport(
loaded=2,
unmatched_to_portfolio=5,
null_uprn=2,
blank_placeholder=1239,
)