"""BOX암거 두께·연장 칸 — 등록부가 정본, B06 그림이 그 칸을 읽음 (2026-09-15 브레인 12장 D ①③). ① 제안값 = 산림과임업기술(임도) 5장 수량산출 예제 — 벽 0.3 · 판 0.25 · 헌치 0.2 · 버림 0.1 근거에 KDS 44 90 00 4.5.2 「부재 최소두께 300㎜」(도로 기준)를 나란히 — 판 0.25 는 못 미침 ② 종전 B06 상수(벽 0.2 · 판 0.3 — 세월교 값 승계)는 근거 없는 값이라 걷음 ③ 연장 칸 — 기본값 없음 """ from __future__ import annotations import json from pathlib import Path from B06_Section.B06_Section_Engine_Culvert import _box_set ROOT = Path(__file__).resolve().parents[2] def _box_options() -> dict[str, dict]: registry = json.loads( (ROOT / "B05_Profile" / "B05_Profile_Structure_Types.json").read_text(encoding="utf-8") ) types = registry if isinstance(registry, list) else registry.get("types") or [] box = next(t for t in types if t["type_id"] == "box_culvert") return {option["key"]: option for option in box["options"]} def test_등록부에_두께_헌치_버림_연장_칸이_선다() -> None: options = _box_options() expected = { "wall_thickness_m": 0.3, "slab_thickness_m": 0.25, "haunch_m": 0.2, "blinding_thickness_m": 0.1, } for key, value in expected.items(): assert options[key]["default"] == value, key assert "산림과임업기술" in options[key]["default_basis"], key # 판 0.25 는 KDS 도로 최소 300㎜ 에 못 미침 — 나란히 적어 설계자가 고르게. assert "KDS" in options["slab_thickness_m"]["default_basis"] assert "300" in options["slab_thickness_m"]["default_basis"] assert "KDS" in options["wall_thickness_m"]["default_basis"] # 연장은 기본값 없음. assert options["length_m"]["default"] is None def test_B06_세트가_등록부_칸을_읽는다() -> None: spec = _box_set(None) assert (spec["wall_thickness_m"], spec["slab_thickness_m"], spec["top_thickness_m"]) == ( 0.3, 0.25, 0.25, ) assert spec["span_m"] == 2.0 + 2 * 0.3 stored = _box_set({"wall_thickness_m": 0.35, "slab_thickness_m": 0.3}) assert (stored["wall_thickness_m"], stored["slab_thickness_m"], stored["top_thickness_m"]) == ( 0.35, 0.3, 0.3, ) assert stored["span_m"] == 2.0 + 2 * 0.35