Files
Aislo/resources/tester/test_b09_operator_class.py

71 lines
3.6 KiB
Python

"""조종원 직종 — 건설품셈 8-1-2 5호 「운전사의 구분」 (2026-09-15 브레인 · 잰 틀림 12 · 조립에 선 것 2).
원문: 건설기계운전사 「…덤프트럭(12ton이상) … 콘크리트 믹서(0.55㎥ 이상) … 공기압축기(이동식, 2.83㎥/min 이상)」
화물차운전사 「12ton미만의 덤프트럭, 화물트럭, 살수차 …」
일반기계운전사 「소형의 공기압축기, 양수기, 소형믹서, 윈치 … 발전기, 래머, 콤팩터 …」
⚠ 옛 잠정 규칙(이름에 트럭 들면 화물차 · 그 밖 전부 건설기계) — 덤프 15t 이 화물차 · 콤팩터·래머·소형믹서가 건설기계로 섰음.
거창 실무 기계경비 「덤프트럭 15Ton 건설기계운전사 · 8Ton·4.5Ton 화물차운전사 · 플레이트 콤팩터 일반기계운전사」 = 원문.
원문이 이름으로 안 가르는 기종(콘크리트 펌프차 · 트랙터(타이어) · 콘크리트 믹서트럭 …)은 **잠정 그대로 + 사유**.
"""
from __future__ import annotations
from B09_Estimation.B09_Estimation_MachineExpenseSheet import machine_expense_sheets
from B09_Estimation.B09_Estimation_MachineOperating import (
_CATALOG_SUBPATH,
_read_json,
load_operating_records,
)
from B09_Estimation.B09_Estimation_UnitPrice import cached_build
ALIASES = _read_json(*_CATALOG_SUBPATH, "labor_const_2026-01-01.json")["variables"]["aliases"]
CONST, TRUCK, GENERAL = (
ALIASES[k] for k in ("labor_op_const", "labor_op_truck", "labor_op_general")
)
def _records():
return {r.machine_code: r for r in load_operating_records().records}
def test_원문이_가르는_직종() -> None:
records = _records()
expected = {
"0602-0150": CONST, # 덤프트럭 15t — 12ton 이상
"0602-0320": CONST,
"0602-0045": TRUCK, # 덤프트럭 4.5t — 12ton 미만
"7204-0055": TRUCK, # 살수차
"1730-0015": GENERAL, # 플레이트 콤팩터
"1630-0080": GENERAL, # 래머
"4205-0045": GENERAL, # 콘크리트 믹서 0.45㎥ — 소형믹서(0.55 미만)
"0201-0070": CONST, # 굴착기
"5205-0035": CONST, # 공기압축기(이동식) 3.5 — 2.83 이상
}
for code, occupation in expected.items():
record = records[code]
assert record.operator_occupation_code == occupation, record
assert record.operator_mapping_is_provisional is False, record
def test_원문이_안_가르는_기종은_잠정_그대로() -> None:
records = _records()
for code in ("2602-0015", "4304-0060"): # 트랙터(타이어) · 콘크리트 믹서트럭
assert records[code].operator_mapping_is_provisional is True, records[code]
assert records["2602-0015"].operator_occupation_code == CONST # 옛 규칙 그대로
assert records["4304-0060"].operator_occupation_code == TRUCK
def test_조립에_선_둘이_원문_직종으로_섬() -> None:
build = cached_build(dump_haul_m=("164.23",))
dump = {r.ref_code for r in build.book.details["X-0602-0150"]}
compactor = {r.ref_code for r in build.book.details["X-1730-0015"]}
assert f"{CONST}#시간" in dump, dump
assert f"{GENERAL}#시간" in compactor, compactor
def test_잠정_직종은_중기경비_장에_사유() -> None:
sheets = {s["machine_code"]: s for s in machine_expense_sheets(cached_build())}
assert sheets["0201-0070"]["operator_note"] == "" # 굴착기 — 원문이 가름
note = sheets["7205-0125"]["operator_note"] # 이동식 임목파쇄기 — 원문 목록에 없음
assert "잠정" in note and "8-1-2" in note, note