Files
Aislo/resources/tester/test_b06_structure_span.py
T
eomsangdonandClaude Opus 5.5 ce7d0125d2 feat(structure): 54-39 · 54-40 · 54-41 선택 안 함 = 값 없음 · 기본값은 칸에 실제 값 · 연동/경사는 흙막이만 · 내공 칸 숨김 · 상자 안 단추 높이 템플릿
- 54-39 고르기 칸 빈 보기 「선택 안 함」 · 「(기본)」 꼬리 · 숫자 칸 「(기본)」 자리표시 · 알약 라벨 「(기본)」 걷음
- 54-39 엔진 짝(파이썬 · TS): 배관 구조 · 형태 · 관종 · 기초 · 길이 · 전 · 후 · 집수정 높이 빈 값 = 값 없음(정의 기본값으로 안 읽음) · 관경 빈 값 = 관 없음 · 집수정 모양(basin_form) 실음
- 54-39 횡단 기하: 구조 · 집수정 모양 안 고름 = 집수정 없음 · 구조 · 형태 안 고른 배관 벽 = 그리지 않음 · patch 형식이 없으면 폼 모양
- 54-39 새로 놓기 · 종류 바꾸기 · 자동 배치 = 집수정 모양 L 도 실제 값
- 54-40 [연동] [경사] = 유입 · 유출 구조 흙막이일 때만 · 집수정 「내공」 줄 화면에서 숨김(값 · 그림 그대로)
- 54-41 상자 안 단추(연동 · 경사 · 선택 · 해제) 높이 = 숫자 칸 묶음 26 · 상자 밖 단추 그대로
- 시험: 새 규칙 기대값(culvert_set · culvert_sets_mirror · structure_span · new_structure_defaults)

화면 확인(sub5_검증): 새 배관 = 1000 · 집수정 L형 1.5 · 흙막이 찰 10 · 1.5 · 5 · 5 실제 값 · (기본) 0 · 유입 집수정 0 ↔ 흙막이 1 단추 줄 · 횡단 eval 형태 빈 값 = 집수정 · 벽 0 · 상자 안 단추 26 · 상자 밖 35.3 · 내공 줄 0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVPp2o6Mh2FZJr72yW3ofZ
2026-10-06 14:37:10 +09:00

70 lines
2.8 KiB
Python

"""구조물 종방향 구간값(길이·기준측점 전/후) 검증 — 2026-08-24 사용자 확정.
기슭막이는 길이 10m·전/후 5·5, 집수정은 길이 2m·전/후 1·1이 기본이다. 세 값이
곧 그 구조물이 덮는 종방향 범위이고, 그 범위에 걸린 옆 측점 횡단도에 같은
기슭막이가 연동으로 선다. 별도 폭 필드는 없다(PLAN.md §4-9).
"""
import sys
from pathlib import Path
PROJECT_ROOT = Path(__file__).resolve().parents[2]
if str(PROJECT_ROOT) not in sys.path:
sys.path.insert(0, str(PROJECT_ROOT))
from B05_Profile.B05_Profile_Structures_Schema import load_structure_types # noqa: E402
from B06_Section.B06_Section_Engine_Culvert import _culvert_set, _side_spec # noqa: E402
def _pipe_option_default(key: str):
for item in load_structure_types():
if item.type_id != "pipe":
continue
for option in item.options:
if option.key == key:
return option.default
raise AssertionError(f"레지스트리에 배관 옵션 {key}가 없다")
def test_registry_defines_basin_before_after():
"""집수정 길이 2m·전/후 각 1m가 레지스트리 기본값으로 있어야 한다."""
assert _pipe_option_default("inlet_basin_length_m") == 2
assert _pipe_option_default("inlet_basin_before_m") == 1
assert _pipe_option_default("inlet_basin_after_m") == 1
def test_basin_side_spec_carries_before_after():
"""유입이 집수정이면 세트 제원에 길이와 전/후가 함께 실린다 — 빈 전/후 = 값 없음(54-39)."""
spec = _culvert_set({"inlet_type": "집수정"})["inlet"]
assert spec["structure"] == "집수정"
assert spec["basin_length_m"] == 2.0
assert spec["basin_before_m"] is None
assert spec["basin_after_m"] is None
# 집수정 쪽에는 기슭막이가 없다 — 벽 제원이 섞이면 링크 판정이 10m로 번진다.
assert "revet_length_m" not in spec
def test_basin_before_after_follow_saved_options():
"""저장분이 있으면 그대로 쓴다 — 비대칭(전 0.5 · 후 1.5)도 허용."""
spec = _side_spec(
{
"inlet_type": "집수정",
"inlet_basin_length_m": 2,
"inlet_basin_before_m": 0.5,
"inlet_basin_after_m": 1.5,
},
{},
"inlet",
)
assert (spec["basin_before_m"], spec["basin_after_m"]) == (0.5, 1.5)
def test_revet_span_defaults_unchanged():
"""빈 길이 · 전 · 후 = 값 없음(54-39 · 정의 기본값으로 안 읽음) · 빈 유출 구조 = 벽 없음."""
culvert = _culvert_set({"inlet_type": "기슭막이"})
spec = culvert["inlet"]
assert spec["revet_length_m"] is None
assert spec["revet_before_m"] is None
assert spec["revet_after_m"] is None
assert culvert["outlet"] == {"role": "outlet", "structure": ""}