"""746-1 지킴 — 기계 줄 M01 요소 후보 · 남은 기계 줄 EQ 후보 · 단위 별칭(요구 585). 요소 후보 셋 · hr = 시간 · 개소 = 개(같은 성격). 쓰기 없음. 옛 고름 대기 줄비교(지문 · 판정)는 785-7 에서 지움. """ from __future__ import annotations import sys from pathlib import Path from M02_MasterTemplete import M02_Hopyo_Elem as elem from M02_MasterTemplete import M02_Hopyo_Sangeun as sg sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "resources/master_data/scripts")) import master_unit as mu # noqa: E402 def test_요소_후보_셋(): got = elem.labor("작업반장") assert 0 < len(got) <= elem.TOP and {x["이름"] for x in got[:2]} == {"작업반장"} assert all(x["키"].startswith("LB") and x["단가"] for x in got) got = elem.machines("굴착기 0.7㎥") assert got and all(x["키"].startswith("EQ") and "굴착기" in x["이름"] for x in got) got = elem.materials("시멘트", "kg") assert got and all(x["키"].startswith("MT") for x in got) and len(got) <= elem.TOP lost = {"갈래": "기계", "이름": "굴착기", "규격": "0.7"} assert elem.lost(lost)[0]["키"].startswith("EQ") def test_안_이은_기계_줄_EQ_후보(): line = {"차례": 0, "이름": "굴착기(타이어)", "규격": "0.7㎥", "단위": "hr", "갈래": "기계"} got = sg.left(line, None) assert got["까닭"] == sg.WHY["기계"] assert got["후보"] and all(x["키"].startswith("EQ") for x in got["후보"]) def test_단위_별칭_hr_시간_개소_개(): assert mu.plain("hr") == mu.plain("시간") and mu.plain("HR") == "시간" assert mu.same_kind("개소", "개") and mu.swap("개소", "개")["배"] == 1 assert mu.swap("10개소", "개")["배"] == 10 and mu.swap("hr", "시간")["계수"] is None assert mu.swap("조", "개소")["계수"] == "사용자" # 조는 묶음 밖 그대로