mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
AuditRow opening and trickle_vent fields are None on all rows 🟥
This commit is contained in:
parent
f105c21d35
commit
f010a360c5
1 changed files with 34 additions and 0 deletions
|
|
@ -2,6 +2,40 @@ from datatypes.magicplan.domain.models import Door, Floor, Plan, Room, Window
|
|||
from backend.magic_plan.audit_script import AuditRow, _build_rows
|
||||
|
||||
|
||||
def test_build_rows_opening_and_trickle_vent_fields_are_none() -> None:
|
||||
# Arrange — plan with one window so opening/trickle_vent fields are exercised
|
||||
plan = Plan(
|
||||
uid="x",
|
||||
name=None,
|
||||
floors=[
|
||||
Floor(level=0, name=None, rooms=[
|
||||
Room(
|
||||
name="Living Room",
|
||||
width_m=3.0,
|
||||
length_m=4.0,
|
||||
area_m2=12.0,
|
||||
windows=[Window(width_m=1.0, height_m=1.0, area_m2=1.0, opening_type="side_hung")],
|
||||
),
|
||||
]),
|
||||
],
|
||||
)
|
||||
|
||||
# Act
|
||||
rows = _build_rows(plan)
|
||||
|
||||
# Assert — all new forward-compatible fields default to None
|
||||
data_row = next(r for r in rows if r.window_label is not None)
|
||||
assert data_row.opening_count is None
|
||||
assert data_row.opening_width_m is None
|
||||
assert data_row.opening_height_m is None
|
||||
assert data_row.opening_total_area_m2 is None
|
||||
assert data_row.trickle_vent_blocked is None
|
||||
assert data_row.trickle_vent_pictured is None
|
||||
assert data_row.trickle_vent_effective_area is None
|
||||
assert data_row.trickle_vent_count is None
|
||||
assert data_row.trickle_vent_total_effective_area is None
|
||||
|
||||
|
||||
def test_build_rows_empty_plan_returns_empty_list() -> None:
|
||||
# Arrange
|
||||
plan = Plan(uid="x", name=None, floors=[])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue