"""기계 카탈로그 이름 — 원천 파싱 병(쪽 끝 이름에 다음 쪽 머리글이 붙고 다음 분류 이름이 빔) 되살림. 2026-09-14 축 C 1장 ① (브레인 차례) · 원문 = 건설공사 표준품셈 제8장 기종 목록 줄. ① 표 머리글(「시 간 당」·「(10-7)」)이 붙은 이름이 하나도 없음 ② 빈 이름이 하나도 없음 ③ 되살린 이름·규격이 원문 차례와 같음 · 취득가는 원천 그대로 """ from __future__ import annotations import json import sys from decimal import Decimal from pathlib import Path ROOT = Path(__file__).resolve().parents[2] sys.path.insert(0, str(ROOT)) from B09_Estimation.B09_Estimation_MachineCost import load_machine_catalog # noqa: E402 CATALOG = load_machine_catalog() def test_표_머리글이_붙은_이름이_없다() -> None: glued = [ m.machine_code for m in CATALOG.machines.values() if "시 간 당" in m.name or "(10-7)" in m.name ] assert glued == [] def test_빈_이름이_없다() -> None: assert [m.machine_code for m in CATALOG.machines.values() if not m.name.strip()] == [] def test_되살린_이름과_규격() -> None: expected = { "5220-0015": ("소형브레이커(전기식)", "1.5㎾"), "7101-0450": ("고성능 착정기", "335.70㎾"), "0240-0007": ("유압식 진동콤팩터(굴착기 부착용)", "0.7"), "3611-0142": ("콘크리트 피니셔(중앙분리대용)", "105.9"), "6802-0100": ("파일천공전용장비", "100"), # 2026-09-18 규격이 되살아남 — 앞서 빈칸이던 것이 원문 규격으로 섰다(기계 원천 벌 재추출) "9070-0020": ("이우선(비자항)", "80ton대선 8ton달기"), } for code, (name, spec) in expected.items(): machine = CATALOG.machines[code] assert (machine.name, machine.specification) == (name, spec), code def test_취득가는_원천_그대로() -> None: raw = json.loads( (ROOT / "resources/data_cost_input_value/mach_base_2026.json").read_text(encoding="utf-8") ) prices = { r["machine_code"]: r["price_thousand_krw"] for r in raw["variables"]["mach_price"]["records"] } for code in ("5220-0015", "0240-0007", "6802-0040", "7930-0100"): assert CATALOG.machines[code].price_thousand_krw == Decimal(str(prices[code]))