handle 50 rows in new template file

This commit is contained in:
Daniel Roth 2026-06-10 16:18:46 +00:00
parent a2a9566ef2
commit e55c2262c8

View file

@ -1,5 +1,7 @@
from __future__ import annotations
from pathlib import Path
import openpyxl
import pytest
@ -199,3 +201,23 @@ def test_writes_zeros_when_door_has_no_ventilation() -> None:
# Assert
assert sheet["T6"].value == 0
_TEMPLATE_PATH = (
Path(__file__).parent.parent.parent.parent
/ "applications"
/ "audit_generator"
/ "Master Sero Template - Data Extraction.xlsx"
)
def test_real_template_survives_18_doors() -> None:
# Row 23 = DATA_START_ROW(6) + 17 — previously a merged separator that caused
# AttributeError: 'MergedCell' object attribute 'value' is read-only
wb = openpyxl.load_workbook(_TEMPLATE_PATH)
sheet = wb["D1 Ventilation"]
plan = _make_plan(num_rooms=18, num_windows_per_room=0, num_doors_per_room=1)
populate_sheet(sheet, plan)
assert sheet["R23"].value == "Room 17"