Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BW6Jdsh18WPtYUR6THZJqn
97 lines
4.3 KiB
Python
97 lines
4.3 KiB
Python
"""표본이 얇은 노임에 신뢰도 표시 (2026-09-09 · PLAN 9-6).
|
|
|
|
⚠⚠ **금액을 막지 않는다.** 단가는 그대로 서고 「조사현장이 적다」는 사실만 나른다 —
|
|
지식DB `노임단가_적용 §2-3` 이 「프로그램에서 단가 채택 시 **플래그 유지 필요**」로,
|
|
`원가_입력변수_사전` 이 「해당 단가 사용 시 **경고 표시**」로 두었는데 노임 층에
|
|
그 표시가 없었다.
|
|
|
|
⚠ 겨누는 것 다섯
|
|
① 원문 기호 그대로 — `*`(조사현장 5개 미만) · `**`(미조사). 우리가 낱말을 지어내지 않음
|
|
② 정상 공표 직종은 **아예 안 담김** (빈 값과 「정상」을 구별할 일이 없게)
|
|
③ 노임 제목에 그 기호가 실림 — 조종원도 노임이라 같이 붙음
|
|
④ ⚠ **내역에 실제로 실린 것만** 경고 — 카탈로그 40직종을 다 띄우면 화면이 묻힘
|
|
⑤ 화면 요약에 사람 말로 실려 나감
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
sys.path.insert(0, str(ROOT))
|
|
|
|
from B09_Estimation.B09_Estimation_MachineOperating import ( # noqa: E402
|
|
LABOR_RELIABILITY_LABEL,
|
|
load_labor_reliability,
|
|
)
|
|
from B09_Estimation.B09_Estimation_PriceBook import PriceKind # noqa: E402
|
|
from B09_Estimation.B09_Estimation_UnitPrice import cached_build # noqa: E402
|
|
from B09_Estimation.B09_Estimation_UnitPrice_View import build_summary # noqa: E402
|
|
|
|
|
|
def test_원문_기호를_그대로_쓴다() -> None:
|
|
"""⚠ 「주의」·「낮음」 같은 우리 낱말로 바꾸면 원문과 못 맞춘다."""
|
|
flags = set(load_labor_reliability().values())
|
|
assert flags <= {"*", "**"}, flags
|
|
assert set(LABOR_RELIABILITY_LABEL) == {"*", "**"}
|
|
|
|
|
|
def test_정상_직종은_담기지_않는다() -> None:
|
|
"""⚠ 빈 값을 담으면 「정상」과 「모름」이 구별되지 않는다 — 있는 것만 담는다."""
|
|
table = load_labor_reliability()
|
|
assert all(v.strip() for v in table.values())
|
|
# 지식DB 가 「원문 40직종 해당」이라 적어 둔 자리다.
|
|
assert len(table) == 40
|
|
|
|
|
|
def test_노임_제목에_기호가_실린다() -> None:
|
|
build = cached_build()
|
|
flagged = load_labor_reliability()
|
|
checked = 0
|
|
for code, flag in flagged.items():
|
|
title = build.book.titles.get(code)
|
|
if title is None:
|
|
continue
|
|
assert title.kind is PriceKind.LABOR
|
|
assert title.reliability == flag, code
|
|
checked += 1
|
|
assert checked > 0, "노임 제목이 하나도 안 섰다"
|
|
|
|
|
|
def test_정상_직종_제목에는_빈_값이다() -> None:
|
|
build = cached_build()
|
|
flagged = load_labor_reliability()
|
|
normals = [
|
|
title
|
|
for code, title in build.book.titles.items()
|
|
# 조종원 시간당 제목(`1050#시간`)은 그 직종 기호를 이어받음 — 직종 코드로 가름(2026-09-15 · 콤팩터가
|
|
# 일반기계운전사(1050 *)로 서며 처음 드러남)
|
|
if title.kind is PriceKind.LABOR and code.split("#")[0] not in flagged
|
|
]
|
|
assert normals, "정상 공표 직종 제목이 하나도 없다"
|
|
assert all(title.reliability == "" for title in normals)
|
|
|
|
|
|
def test_내역에_실린_것만_경고한다() -> None:
|
|
"""⚠ 카탈로그 40직종을 다 띄우면 **쓰지도 않는 직종**이 화면을 채운다."""
|
|
build = cached_build()
|
|
used = build.labor_reliability
|
|
assert 0 < len(used) < len(load_labor_reliability())
|
|
# 실제로 일위대가에 붙은 줄만 들어 있다.
|
|
attached = {row.ref_code for rows in build.book.details.values() for row in rows}
|
|
assert set(used) <= attached
|
|
|
|
|
|
def test_화면_요약에_사람_말로_나간다() -> None:
|
|
"""⚠ 기호만 보내면 사용자가 `*` 가 무슨 뜻인지 모른다 — 뜻을 함께 보낸다."""
|
|
summary = build_summary(cached_build())
|
|
rows = summary["labor_reliability"]
|
|
assert rows, "표본이 얇은 노임이 하나도 안 실렸다"
|
|
for row in rows:
|
|
assert set(row) == {"code", "name", "flag", "why"}
|
|
assert row["flag"] in {"*", "**"}
|
|
assert row["why"] == LABOR_RELIABILITY_LABEL[row["flag"]]
|
|
# 지식DB 가 예로 든 임도 빈발 직종 — 실제로 우리 내역에 실린다.
|
|
assert any(row["code"] == "1050" for row in rows), "일반기계운전사(1050)가 안 잡힌다"
|