Files
Aislo/resources/tester/test_m02_precombo_class.py
T
eomsangdonandClaude Opus 5.5 d4e3affc1f refactor(858 5-8 ②): 서고 옛 꼴 읽기 변환 · 부르는 곳 0 걷음
- 옛 꼴 읽기 변환 걷음(요구 899 — 옛 꼴 호환 없음 · storage 전 층 서고 문서 20 · 프로젝트 사본 = 칸 없는 문서 0 · 옛 품셈 분류 0 · 옛 단가승격 참조 0 · promote 파일 0): `Labor_Ref.filled`(51-12 · 134-5 칸 채움) · `unpromote`(134-2 승격 참조 → 로직 줄) · 층 양식 읽기 길의 두 부름 · `summary` 의 칸 채움
- 부르는 곳 0(저장소 전체 · 시험 포함 다시 셈): `Template_Layers.note_source` · 내 기계 글 키 9(Copied · Win_Edit · Win_Blank · Win_Ok · Win_Cancel · Win_Edit_Note · Win_Uses · Why_M01 · Why_Company)
- 남김: `Library_Delete._restore`(부르는 곳이 store.batch 안 · 되돌림을 batch 가 맡게 하려면 Store 몸을 고쳐야 함 — 이번 몫 밖) · 주석만 고침
- 시험: 걷은 두 변환만 붙들던 시험 지움(labor_ref 옛 참조 줄 셋 · 칸 채움 단언 · precombo_class 옛 품셈 분류 하나)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 10:10:39 +09:00

55 lines
2.2 KiB
Python

"""일위대가 사전조합 구분 · 상세구분 새 분류(PLAN 134-5) — 구조물군 A~G › 그 군 종류 + 「공통」.
- 원천 = 마스터 `구조물정의.json`(구조물군 · types) — 군마다 첫 상세구분 「공통」 · 꺼진 종류도 · 「호환(기타)」 뺌
- 새 문서 = 빈 값(미분류) · 상세 드롭다운 원천 = 구조물 정의(로직 구분 목록 아님)
"""
import json
import os
import subprocess
from pathlib import Path
HERE = os.path.dirname(os.path.abspath(__file__))
ROOT = Path(HERE).parents[1]
M02 = ROOT / "M02_MasterTemplete"
def test_분류는_구조물군_종류_공통():
defn = json.loads((ROOT / "resources/master_template/구조물정의.json").read_text("utf-8"))
proc = subprocess.run(
["node", os.path.join(HERE, "helper_m02_precombo_scope.cjs")],
input=json.dumps({"rows": [], "def": defn}, ensure_ascii=False),
capture_output=True,
text=True,
encoding="utf-8",
check=True,
)
classes = json.loads(proc.stdout)["classes"]
groups = {k: v for k, v in defn["구조물군"].items() if k in "ABCDEFG"}
assert [c["name"] for c in classes] == list(
groups.values()
) # A 횡단배수 … G 노면공 · 기타 없음
c = next(c for c in classes if c["name"] == groups["C"])
assert c["details"] == [
"공통",
"옹벽",
"돌쌓기(찰)",
"돌쌓기(메)",
"흙막이",
"큰돌쌓기",
"소단",
]
b = next(c for c in classes if c["name"] == groups["B"])
assert "측구(옆도랑)" in b["details"] # 꺼진 종류도 넣음
assert all(
c["details"][0] == "공통" and len(set(c["details"])) == len(c["details"]) for c in classes
)
def test_화면_원천은_구조물_정의_새_문서는_미분류():
detail = (M02 / "M02_MasterTemplete_Labor_LibMeta.ts").read_text("utf-8") # 717-3 나눔
assert "subs = precomboClasses(def);" in detail and "fetchLibLogicSubs" not in detail
assert '[...new Set([now ?? "", ...names])]' in detail # 지금 값도 선택지 그대로
lib = (M02 / "M02_MasterTemplete_Library_List.ts").read_text("utf-8")
assert '구분: "", 상세구분: ""' in lib and "fetchLibLogicSubs" not in lib