Files
Aislo/resources/tester/test_52_structure_spec_pipe.py
T
eomsangdonandClaude Opus 5.5 f93cc56284 fix(B05·B06): 54-30 추가 흙막이 강조 유지 · 관 보호공 [연동] [경사] · 칸 고침 강조 · 흙막이 칸 일원화
- 폼이 상자를 새로 세울 때마다(단 수 · 유입 형식 · 벽 조작 · 저장 · 넘김) 고른 상자 강조 다시(specpaint 한 곳) · 54-29 의 두 군데 호출 대체
- 관 보호공(유입 · 유출) 상자 안 [연동] [경사] 반 폭 두 단추 — 옛 연동 제어 값(revet_link_detached · revet_follow_grade) 그대로 · 쓸 수 있을 때만 활성 · 경사 끄면 연동 잠김 · 누르면 횡단 그림 바로
- 상자 칸을 고치거나 고르면 그 벽을 고름(횡단에서 누른 것과 같은 길 · 카드 다시 그림) · 단 수 칸은 고른 단을 지킴
- 추가 흙막이 상자 = 사면안정 흙막이와 같은 칸(형태 · 길이 · 높이 · 전 · 후) · 구조 고르기 칸과 정의 이름 두 줄 뺌 · 저장 키 그대로
- 시험 54-29 · 54-27 · 52 명세 · 54-14 말풍선 기대값 맞춤

화면 확인(sub5_검증 12+18): 흙막이 1 강조 = 단 2→1 · 넘김 · 저장 뒤 유지 · 형태 고침 → 상자 · 벽 강조 · 경사 끔 → 13+0 벽 이동 · 두 줄 함께 · 목록 대 횡단 같은 글(칸 54) · 단 0 저장으로 되돌림

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

112 lines
3.9 KiB
Python

# -*- coding: utf-8 -*-
"""구조물 명세 공용 틀 + 횡단배수 › 배관(표 01) — PLAN 52-1.
순수 규칙은 Node 헬퍼(`helper_52_structure_spec.cjs`)가 돌림 · 화면은 ORCA `ui_checks/52-1_배관_컨테이너.js`.
"""
import json
import os
import subprocess
import pytest
HERE = os.path.dirname(os.path.abspath(__file__))
ROOT = os.path.dirname(os.path.dirname(HERE))
def _node(*args):
proc = subprocess.run(
["node", os.path.join(HERE, "helper_52_structure_spec.cjs"), *args],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
@pytest.fixture(scope="module")
def out():
return _node()
def test_컨테이너_다섯_필수_셋_선택_둘(out):
assert out["containers"] == [
["pipe", "관", True],
["inlet", "관 보호공 (유입)", True],
["outlet", "관 보호공 (유출)", True],
["soil_add", "흙막이", False],
["chute_add", "도수로/돌붙임", False],
]
def test_형태_선택지는_구조를_따름(out):
assert out["formBasin"] == ["I형", "L형", "ㄷ형"]
assert out["formSoil"] == [
"돌 쌓기(찰)",
"돌 쌓기(메)",
"콘크리트",
"돌망태",
"통나무/목재틀",
"바자",
]
assert out["formNone"] is None # 구조 안 고름 = 형태 칸 가림
assert out["outletForms"] == out["formSoil"]
def test_옛_키로_읽고_같은_키로_씀_옛_칸은_안_씀(out):
back = out["back"]
assert back["pipe_diameter_mm"] == 1000
# 집수정 = 길이 · 전 · 후 칸 없음(54-1) — 폼이 안 적음(병합이 옛 값을 지킴)
assert back["inlet_structure"] == "L" and "inlet_basin_length_m" not in back
assert back["outlet_revet_height_m"] == 2.5
# 표 01 에 없는 옛 칸은 폼이 안 적음(병합이 이어 붙임 = 지난 정의 값)
assert "pipe_kind" not in back and "wing_wall_type" not in back
def test_선택_컨테이너는_인스턴스마다_차례대로_다시_매김(out):
# 흙막이 상자 = 구조 고르기 없음(54-30) — 옛 구조 키만 든 상자도 자리는 지킴
assert [i["form"] for i in out["state"]["soil_add"]] == ["바자", ""]
assert out["back"]["soil_add_1_form"] == "바자"
assert out["back"]["soil_add_2_form"] == "" # 빈 상자 자리 표식 = 첫 칸(형태) 빈 글
assert out["back"]["chute_add_1_structure"] == "도수로"
def test_흙막이로_바꾸면_기슭막이_키와_revet(out):
s = out["soilOut"]
assert s["inlet_type"] == "기슭막이" and s["inlet_structure"] == "revet"
assert s["inlet_revet_form"] == "콘크리트" and s["inlet_revet_length_m"] == 6
assert "inlet_basin_length_m" not in s
def test_길이_전_후_맞물림_마지막에_고친_둘을_지킴(out):
sp = out["split"]
assert sp["lengthFromSides"]["length"] == "7"
assert sp["beforeFromLength"]["before"] == "6"
assert sp["defaultKeepsLength"]["after"] == "7"
assert sp["blankKept"]["length"] == "" # 지킬 칸이 비면 안 셈
assert sp["clamp"]["before"] == "0"
def test_잇기_키와_이름_바꿈(out):
assert out["links"] == ["grv6lny", "gnbf9m9", "g9lq9uk", "gsoiladd2", "gchuteadd2"]
assert out["names"] == {
"renamed": "모양",
"title": "그룹 이름",
"titleOwn": "유입 보호",
"choice": "ㄷ형",
}
assert {"soil_add_", "chute_add_"} == set(out["keys"]["prefixes"])
def test_정의_파일에_이름_표가_올라_있음():
names = _node("names")
with open(
os.path.join(ROOT, "resources", "master_template", "구조물정의.json"), encoding="utf-8"
) as f:
doc = json.load(f)
on_file = doc["종류"]["pipe"]["이름"]
assert set(names) == set(on_file)
assert on_file["inlet.structure=기슭막이"] == "흙막이"