"""B08 수리집수면적표 — 박스암거 · 세월교 지점은 따로 장(73-1 빈 장 → 73-11 · 73-12 계산 장).""" from __future__ import annotations import sys from pathlib import Path ROOT = Path(__file__).resolve().parents[2] sys.path.insert(0, str(ROOT)) from B08_Quantity.B08_Quantity_Hydro_Defaults import station_rows # noqa: E402 from common_util.common_util_drainage_pipes import PipePoint # noqa: E402 def _point(chainage: float, facility: str) -> PipePoint: point = PipePoint.__new__(PipePoint) point.chainage_m = chainage point.facility = facility return point def test_박스_세월교만_빈_장_탭_수는_그_구조물_수() -> None: points = [ _point(173.0, "ford_bridge"), _point(85.0, "pipe"), _point(300.0, "box_culvert"), _point(352.0, "ford_bridge"), _point(400.0, "ford_pavement"), ] rows = station_rows(points) assert [r["chainage_m"] for r in rows] == [85.0, 173.0, 300.0, 352.0, 400.0] # 73-11 · 73-12 뒤 — 빈 장 대신 박스 · 월류 장(물넘이포장도 월류 장) special = [r for r in rows if r["sheet"] != "pipe"] assert len(special) == 4 # 세월교 2 · 박스 1 · 물넘이 1 assert {r["kind"] for r in special} == {"세월교", "박스암거", "물넘이포장"} assert [r["facility"] for r in rows if r["sheet"] == "pipe"] == ["pipe"] assert all(r["kind"] == "" for r in rows if r["sheet"] == "pipe")