- 옮김: B04 2 · B05 23 · B06 11 · A00_Common/design 13 (9,299 줄) · 이미 logic/ 에 있던 16 파일 그대로 - 안 옮김: 묶음 입구(package.json build:*) · 파이썬 · 순수지만 계산 아닌 8 (보기 결선 · 콜백 · API 타입 · 갈아끼움 알림판) - import 266 줄(142 파일) · 시험 · 주석 · 짝 표시 문자열 경로 고침 · B05 · B06 CLAUDE.md 짝 줄 logic/ - 시험 도우미 새 경로: 가짜 require 열쇠 · B05()/B06() 부름 · 형제 import 자리 · tsc 묶어 돌리는 시험 · 정규식 · rglob - design_view_cross 줄 한도 시험 685 → 688 (긴 import 경로 줄바꿈 3줄) - 확인: typecheck 0 · 서버 묶음 넷(corridor · server-calc · b07-extent · b07-note) 다시 지어 코드 같음(//#region 경로 주석만 다름) · 관련 시험 270 파일 — 남은 실패 19 는 옮기기 전과 같음 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014utrjfoW831Vc5wJUd13kL
103 lines
3.6 KiB
Python
103 lines
3.6 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""안전부대용지(표 07) — PLAN 52-7.
|
|
|
|
정의(대피로 · 가드레일 컨테이너 · 점형 일곱) · 옛 대피 종류 읽기(`asRoad`) · 고르기 목록 숨김 =
|
|
구조물 표 처음값(322-1 · 옛 `pickable`) · 화면은 ORCA `ui_checks/52-7_안전부대용지.js`.
|
|
"""
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
|
|
from B05_Profile.B05_Profile_Structures_Schema import structure_type_map
|
|
from common_util.common_util_structure_catalog import load_parts
|
|
from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition
|
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
ROOT = os.path.dirname(os.path.dirname(HERE))
|
|
POINTS = [
|
|
"mirror",
|
|
"curb",
|
|
"hazard_sign",
|
|
"position_sign",
|
|
"water_intake",
|
|
"completion_sign",
|
|
"barrier_gate",
|
|
]
|
|
|
|
|
|
def test_정의_검사_통과():
|
|
assert definition.check(definition.read()) == []
|
|
|
|
|
|
def test_컨테이너_없는_일곱은_점형_옵션_없음():
|
|
types = structure_type_map()
|
|
for tid in POINTS:
|
|
t = types[tid]
|
|
assert (t.group, t.placement, t.options) == ("E", "point", []), tid
|
|
assert [types[t].name for t in ("curb", "hazard_sign", "water_intake")] == [
|
|
"경계석",
|
|
"위험표시",
|
|
"취수정",
|
|
]
|
|
|
|
|
|
def test_대피로_가드레일_상세_내용_컨테이너():
|
|
doc = definition.read()
|
|
groups = doc["그룹"]
|
|
assert groups["evac_road"] == [
|
|
{"id": "gevacdetail", "이름": "상세 내용", "옵션": ["detail"], "형상": {}}
|
|
]
|
|
assert groups["guardrail"][0]["옵션"] == ["form", "length_m", "before_m", "after_m"]
|
|
types = structure_type_map()
|
|
road = types["evac_road"]
|
|
assert road.placement == "point"
|
|
assert road.options[0].choices == ["대피소", "정차/작업장", "차돌림곳"]
|
|
guard = types["guardrail"]
|
|
assert guard.name == "가드레일" and guard.placement == "interval"
|
|
assert [(o.key, o.input) for o in guard.options] == [
|
|
("form", "text"),
|
|
("length_m", "number"),
|
|
("before_m", "number"),
|
|
("after_m", "number"),
|
|
]
|
|
# 옛 대피 종류는 정의에 그대로(옛 기록 도면 · 집계)
|
|
assert {"refuge", "work_yard", "turnaround"} <= set(types)
|
|
|
|
|
|
NODE = r"""
|
|
const fs = require("fs"), path = require("path");
|
|
const ts = require(path.join(process.argv[1], "config", "node_modules", "typescript"));
|
|
const src = fs.readFileSync(
|
|
path.join(process.argv[1], "B05_Profile", "logic", "B05_Profile_UI_Structures_Define.ts"), "utf8");
|
|
const js = ts.transpileModule(src, {
|
|
compilerOptions: { module: ts.ModuleKind.CommonJS } }).outputText;
|
|
const m = { exports: {} };
|
|
new Function("exports", "module", js)(m.exports, m);
|
|
const d = m.exports;
|
|
process.stdout.write(JSON.stringify({
|
|
old: d.asRoad({ type_id: "turnaround", options: { width_m: 10 } }),
|
|
other: d.asRoad({ type_id: "mirror", options: { facing: "좌" } }),
|
|
}));
|
|
"""
|
|
|
|
|
|
def test_옛_대피_종류는_대피로_상세로_읽고_목록에서_뺌():
|
|
proc = subprocess.run(
|
|
["node", "-e", NODE, ROOT],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
timeout=60,
|
|
)
|
|
assert proc.returncode == 0, proc.stderr
|
|
out = json.loads(proc.stdout)
|
|
assert out["old"] == {
|
|
"type_id": "evac_road",
|
|
"options": {"detail": "차돌림곳", "width_m": 10},
|
|
}
|
|
assert out["other"] == {"type_id": "mirror", "options": {"facing": "좌"}}
|
|
start = load_parts()["처음값"] # 고르기 목록 = 구조물 표(322-1 · 옛 대피 셋 hidden)
|
|
kinds = ("refuge", "work_yard", "turnaround", "evac_road", "guardrail")
|
|
assert [start[t]["목록"] for t in kinds] == ["hidden"] * 3 + ["both"] * 2
|