Files
Aislo/resources/tester/test_52_10_structure_spec_road.py
T
eomsangdonandClaude Sonnet 5.5 fc36f0ae4e feat(B05): 노면공 시작 · 종료 측점 · 길이 출력 · 기준 · 전/후 없음(87-1)
- 노면공 명세 byRange: 위치 줄 = 시작 · 종료 측점만(기준 측점 칸 없음 · 알약 = 시점) · 상세 내용 = 포장사양 → 길이(시작~종료 출력) → 높이
- 포장사양 선택지 콘크리트 · 아스콘 · 쇄석 · 높이 기본 0.20 m
- 저장 꼴: placement interval · start_m · end_m · options.pave_spec · height_m · 옛 length_m · before_m · after_m 은 [수정] 저장 때 뺌
- 구조물정의 판 20(판_19 이력) · 노면공 길이 · 전 · 후 옵션 빼고 height_m 기본값
- 시험: test_52_10 맞춤

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVPp2o6Mh2FZJr72yW3ofZ
2026-10-08 12:03:38 +09:00

80 lines
2.9 KiB
Python

# -*- coding: utf-8 -*-
"""노면공 › 콘크리트 포장 명세 · 기타 이름(사용자 구조물 표 08) — PLAN 52-10.
순수 규칙은 Node 헬퍼(`helper_52_structure_spec.cjs road`)가 돌림 ·
화면은 ORCA `ui_checks/52-10_노면공_기타.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))
DEFINITION = os.path.join(ROOT, "resources", "master_template", "구조물정의.json")
@pytest.fixture(scope="module")
def out():
proc = subprocess.run(
["node", os.path.join(HERE, "helper_52_structure_spec.cjs"), "road"],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
def test_명세_등록_필수_컨테이너_하나(out):
assert {"pipe", "pavement_concrete"} <= set(out["registered"]) # 다른 창 명세도 함께 등록됨
assert out["same"] is True
assert out["containers"] == [["detail", "상세 내용", True, "gpavedetail"]]
def test_포장사양_선택지는_명세_한_곳(out):
assert out["choices"] == ["콘크리트", "아스콘", "쇄석"]
def test_상세내용_차례_포장사양_길이_출력_높이(out):
assert out["items"] == [
["spec", "포장사양", "select"],
["length", "길이 (m)", "auto"],
["height", "높이 (m)", "number"],
]
def test_저장_키_왕복_옛_칸은_명세_밖(out):
assert out["state"] == {"detail": [{"spec": "콘크리트", "height": "0.2"}]}
assert out["edited"] == {"pave_spec": "콘크리트", "height_m": 0.35}
assert out["cleared"] == {"pave_spec": "콘크리트"}
assert out["keys"] == {"keys": ["pave_spec", "height_m"], "prefixes": []}
# 길이 · 기준측점 전/후는 입력 없음 — 시작 · 종료만 받고 옛 값은 저장 때 뺌(87-1)
assert out["byRange"] is True
assert out["dropped"] == ["length_m", "before_m", "after_m"]
assert "length_m" not in out["retired"]
assert set(out["retired"]) == {
"thickness_cm",
"width_m",
"widening_area_m2",
"joint_spacing_m",
"separation_sheet",
"wire_mesh",
}
def test_기타_상세_종류_이름_글_칸():
with open(DEFINITION, encoding="utf-8") as f:
doc = json.load(f)
etc = next(t for t in doc["types"] if t["type_id"] == "etc")
name = next(o for o in etc["options"] if o["key"] == "name")
assert name["label"] == "상세 종류 이름" and name["input"] == "text"
pave = next(t for t in doc["types"] if t["type_id"] == "pavement_concrete")
keys = [o["key"] for o in pave["options"]]
assert not {"length_m", "before_m", "after_m"} & set(keys) # 87-1 시작 · 종료 직접 입력
height = next(o for o in pave["options"] if o["key"] == "height_m")
assert height["default"] == 0.2