mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Window with no custom_displayable_fields yields ventilation=None 🟩
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9a3987b4f1
commit
cda2091e23
1 changed files with 16 additions and 2 deletions
|
|
@ -4,8 +4,8 @@ from typing import Any
|
|||
|
||||
import pytest
|
||||
|
||||
from datatypes.magicplan.api.response import MagicPlanPlan
|
||||
from datatypes.magicplan.domain.mapper import map_plan
|
||||
from datatypes.magicplan.api.response import MagicPlanPlan, Symbol, Vec3, WallItem
|
||||
from datatypes.magicplan.domain.mapper import _map_window, map_plan
|
||||
from datatypes.magicplan.domain.models import Plan
|
||||
|
||||
FIXTURE_DIR = Path(__file__).parents[4] / "backend" / "magic_plan"
|
||||
|
|
@ -240,6 +240,20 @@ def plan_new() -> Plan:
|
|||
return map_plan(MagicPlanPlan.model_validate(payload["data"]))
|
||||
|
||||
|
||||
def test_window_with_no_custom_fields_has_no_ventilation() -> None:
|
||||
wi = WallItem(
|
||||
uid="test",
|
||||
symbol=Symbol(id="windowcasement", name="Casement Window", valid=True),
|
||||
size=Vec3(x=1.0, y=0.0, z=1.2),
|
||||
position=Vec3(x=0.0, y=0.0, z=0.0),
|
||||
rotation=Vec3(x=0.0, y=0.0, z=0.0),
|
||||
)
|
||||
|
||||
window = _map_window(wi)
|
||||
|
||||
assert window.ventilation is None
|
||||
|
||||
|
||||
def test_kitchen_window_has_ventilation(plan_new: Plan) -> None:
|
||||
# Arrange — Kitchen is floor 0 room 0; its only window is a windowcasement
|
||||
# with custom_displayable_fields populated in the new fixture.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue