- 콘크리트 포장 = 기준 측점 + 필수 컨테이너 「상세 내용」(포장사양 고르기 · 높이 m 손 입력) · 구조물 조합 잇기 - 포장사양 선택지는 명세 한 곳(PAVE_SPEC_CHOICES · 지금 콘크리트 하나) · 새 키 pave_spec · height_m - 구간 길이 · 전 · 후는 정의 칸 그대로 · 표에 없는 옛 상세 칸(두께 · 폭 · 확폭 · 줄눈 · 비닐 · 철망)은 화면에서 빼고 지난 정의 값으로 보존 - 일반 구조물(structures.json)도 명세 폼을 옵션 칸 아래에 그림(B05_Profile_UI_Structures_Spec) · 잠금은 옵션 칸을 따름 · [수정] 병합은 명세 키를 다시 씀 - 기타 이름 칸 = 「상세 종류 이름」(정의 판 8 · 이력 판_7) · 목록 이름으로 씀 · 종류 단위 잇기 그대로 - 시험: test_52_10_structure_spec_road · 헬퍼 road · ui_checks/52-10_노면공_기타(B05 · B06 같음 · 되돌림) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KYZ2HWWdUwZWYnn3tQz7X
66 lines
2.3 KiB
Python
66 lines
2.3 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 out["registered"] == ["pipe", "pavement_concrete"]
|
|
assert out["same"] is True
|
|
assert out["containers"] == [["detail", "상세 내용", True, "gpavedetail"]]
|
|
|
|
|
|
def test_포장사양_선택지는_명세_한_곳(out):
|
|
assert out["choices"] == ["콘크리트"]
|
|
|
|
|
|
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": []}
|
|
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")
|
|
assert [o["key"] for o in pave["options"]][:3] == ["length_m", "before_m", "after_m"]
|