mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
from datetime import date
|
|
|
|
from domain.condition.aspect_type import AspectType
|
|
from domain.condition.element_type import ElementType
|
|
from domain.condition.mapping.calico.calico_mapper import CalicoMapper
|
|
from domain.condition.records.calico.calico_asset_condition import CalicoAssetCondition
|
|
from domain.condition.records.calico.calico_property import CalicoProperty
|
|
|
|
|
|
def test_calico_mapper_sets_renewal_year_to_export_year_plus_remaining_life():
|
|
# Arrange
|
|
calico_property = CalicoProperty(
|
|
uprn=100093305101,
|
|
assets=[
|
|
CalicoAssetCondition(
|
|
asset_reference=443,
|
|
path="Roof Covering",
|
|
covering_type="Concrete Tiles",
|
|
fitted_date=date(1998, 4, 1),
|
|
quantity=55,
|
|
remaining_life=36,
|
|
)
|
|
],
|
|
)
|
|
export_year = 2026
|
|
|
|
# Act
|
|
survey = CalicoMapper().map_asset_conditions_for_property(
|
|
calico_property, export_year
|
|
)
|
|
|
|
# Assert
|
|
roof_material = survey.elements[0].aspect_conditions[0]
|
|
assert roof_material.aspect_type is AspectType.MATERIAL
|
|
assert survey.elements[0].element_type is ElementType.ROOF
|
|
assert roof_material.renewal_year == export_year + 36
|