mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
38 lines
1.1 KiB
Python
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,
|
|
)
|