mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
44 lines
1.2 KiB
Python
44 lines
1.2 KiB
Python
"""Landlord property-type / built-form → whole-dwelling Simulation Overlay (ADR-0032).
|
|
|
|
The landlord value is written as-is onto the top-level EpcSimulation fields;
|
|
"Unknown" resolves to no overlay.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
from domain.epc.property_overlays.attribute_overlay import (
|
|
built_form_overlay_for,
|
|
property_type_overlay_for,
|
|
)
|
|
|
|
|
|
def test_property_type_override_sets_the_whole_dwelling_property_type() -> None:
|
|
# Act
|
|
simulation = property_type_overlay_for("House", 0)
|
|
|
|
# Assert
|
|
assert simulation is not None
|
|
assert simulation.property_type == "House"
|
|
|
|
|
|
def test_built_form_override_sets_the_whole_dwelling_built_form() -> None:
|
|
# Act
|
|
simulation = built_form_overlay_for("Semi-Detached", 0)
|
|
|
|
# Assert
|
|
assert simulation is not None
|
|
assert simulation.built_form == "Semi-Detached"
|
|
|
|
|
|
@pytest.mark.parametrize("value", ["Unknown", ""])
|
|
def test_unknown_property_type_produces_no_overlay(value: str) -> None:
|
|
# Act / Assert
|
|
assert property_type_overlay_for(value, 0) is None
|
|
|
|
|
|
@pytest.mark.parametrize("value", ["Unknown", ""])
|
|
def test_unknown_built_form_produces_no_overlay(value: str) -> None:
|
|
# Act / Assert
|
|
assert built_form_overlay_for(value, 0) is None
|