mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
_write_data_rows places door data at cols 22–25 (V–Y) 🟥
This commit is contained in:
parent
a748260b7d
commit
500ec02be2
1 changed files with 26 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import openpyxl
|
||||
from datatypes.magicplan.domain.models import Door, Floor, Plan, Room, Window
|
||||
from backend.magic_plan.audit_script import AuditRow, _apply_section_borders, _build_rows, _write_headers
|
||||
from backend.magic_plan.audit_script import AuditRow, _apply_section_borders, _build_rows, _write_data_rows, _write_headers
|
||||
|
||||
|
||||
def test_build_rows_opening_and_trickle_vent_fields_are_none() -> None:
|
||||
|
|
@ -276,3 +276,28 @@ def test_apply_section_borders_sets_medium_right_border_on_boundary_columns() ->
|
|||
# Assert — non-boundary columns are untouched
|
||||
for col in (1, 6, 12, 22):
|
||||
assert ws.cell(row=1, column=col).border.right.style is None, f"col {col}"
|
||||
|
||||
|
||||
def test_write_data_rows_places_door_data_at_cols_22_to_25() -> None:
|
||||
# Arrange
|
||||
wb = openpyxl.Workbook()
|
||||
ws = wb.active # type: ignore[assignment]
|
||||
rows = [
|
||||
AuditRow(
|
||||
room_name="Hall",
|
||||
room_width_m=2.0,
|
||||
room_length_m=3.0,
|
||||
room_area_m2=6.0,
|
||||
door_location="Hall",
|
||||
door_width_mm=762.0,
|
||||
),
|
||||
]
|
||||
|
||||
# Act
|
||||
_write_data_rows(ws, rows)
|
||||
|
||||
# Assert — door columns at V–Y (22–25), not old positions 28–31
|
||||
assert ws.cell(row=1, column=22).value == "Hall"
|
||||
assert ws.cell(row=1, column=23).value == 762.0
|
||||
assert ws.cell(row=1, column=28).value is None
|
||||
assert ws.cell(row=1, column=29).value is None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue