Files
Aislo/resources/tester/test_b09_machine_catalog_names.py
T
eomsangdonandClaude Opus 5 808cf0f289 fix(b09): 기계 카탈로그 이름 되살림 — 표 머리글 붙은 5건 · 빈 이름 29건(원천 쪽 넘김 파싱 병)
- 쪽 끝 기종 이름에 다음 쪽 머리글·다음 분류 이름이 붙고, 다음 분류 첫 기종들은 이름이 비던 병
- 이름·규격은 건설공사 표준품셈 제8장 기종 목록 줄에서 읽음 · 취득가·손료계수는 원천 그대로
- 대형 브레이커 되살림 표 옆에 같은 약속으로 둠(원천이 실으면 지움)
- 자원 축 781/386 · 범위 81공종 상태 전후 같음 · 시험 4건

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BW6Jdsh18WPtYUR6THZJqn
2026-09-14 07:49:02 +09:00

61 lines
2.2 KiB
Python

"""기계 카탈로그 이름 — 원천 파싱 병(쪽 끝 이름에 다음 쪽 머리글이 붙고 다음 분류 이름이 빔) 되살림.
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"),
"9070-0020": ("이우선(비자항)", ""),
}
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]))