Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016VBGFXB9AbJBwXP19z75Qq
62 lines
2.5 KiB
Python
62 lines
2.5 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""BOX암거·세월교·물넘이포장 — **기본값으로 그린 칸을 그림에 적음** (2026-09-14 브레인 판정 ②③).
|
|
|
|
폼이 기본값을 안 보내게 고친 뒤, 비운 칸은 횡단도가 등록부 기본값으로 그리고 있었음. 저장만 안 하면
|
|
된다고 볼 일이 아님 — 그림이 설계값처럼 보이는 것이 같은 병. 세트 제원이 `defaulted` 「이름 값」을
|
|
싣고 카드 머리가 「⚠ … 기본값(미확정)」으로 보임. 물넘이 월류 높이가 비면 파임을 안 그리는 까닭도 보임.
|
|
TS 짝은 거울 시험(`test_b06_culvert_sets_mirror`)이 딕셔너리째 대조함.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
if str(ROOT) not in sys.path:
|
|
sys.path.insert(0, str(ROOT))
|
|
|
|
from B06_Section.B06_Section_Engine_Culvert import ( # noqa: E402
|
|
_box_set,
|
|
_ford_pavement_set,
|
|
_ford_set,
|
|
)
|
|
|
|
CHROME = (ROOT / "B06_Section" / "B06_Section_UI_Cross_Card_Chrome.ts").read_text(encoding="utf-8")
|
|
CONTROLS = (ROOT / "B06_Section" / "B06_Section_UI_Page_Ford_Controls.ts").read_text(
|
|
encoding="utf-8"
|
|
)
|
|
|
|
|
|
def test_BOX_빈_칸은_기본값_목록에_선다() -> None:
|
|
items = _box_set({})["defaulted"]
|
|
assert "본체 폭 2" in items and "본체 높이 2" in items
|
|
assert "유입 날개벽 있음" in items and "유출 날개벽 각도 45" in items
|
|
|
|
|
|
def test_적은_칸은_목록에서_빠진다() -> None:
|
|
items = _box_set({"body_width_m": 3.0, "wing_in": "없음"})["defaulted"]
|
|
assert not any(item.startswith("본체 폭 ") for item in items)
|
|
# 안 세운 날개벽은 치수를 안 봄.
|
|
assert not any(item.startswith("유입 날개벽") for item in items)
|
|
assert "본체 높이 2" in items
|
|
|
|
|
|
def test_세월교_월류_폭_관경도_적힌다() -> None:
|
|
items = _ford_set({"ford_width_m": 12.0})["defaulted"]
|
|
assert "관경 1000" in items and "월류 높이 0" in items
|
|
assert not any(item.startswith("월류 폭 ") for item in items)
|
|
|
|
|
|
def test_물넘이_월류_높이가_비면_파임_없음() -> None:
|
|
spec = _ford_pavement_set({})
|
|
assert spec["depth_m"] is None
|
|
assert spec["defaulted"] == ["월류 폭 5"]
|
|
|
|
|
|
def test_카드_머리가_목록과_까닭을_보인다() -> None:
|
|
assert "기본값(미확정)" in CHROME
|
|
assert "월류 높이 없음 — 파임 안 그림" in CHROME
|
|
# 조작으로 값이 오면 목록에서 뺌 — 캐시를 바로 고치는 길.
|
|
assert CONTROLS.count("dropDefaulted(spec,") == 4
|