chore(853-2): 걸음 0 묶음 ⑤ — DataFlow 남은 흐름도 잔재 · 금액 표준 표 걷음

- 지움: DataFlow/M02_DF_Round.ts(가져가는 곳 0) · _standard/금액단위표준.json · /df/standards 답의 money 칸(단위 고르기는 unit 만 씀)
- M02_DF_Values: 흐름도 입력 값 길(values · one_value · materials · slot_price · group_find · standards_check 와 딸린 함수 · 550 → 62 줄) — 남김 = Item_Prices 가 쓰는 _pick · _group_rows · GROUP_RULE · MACHINE_SEP · HOURLY + standards
- 시험: 옛 값 찾기만 보던 test_m02_df_values_old 지움 · 794-1b 표준 표 기대를 unit 만으로
- 검증: 빌더 --check 같음 · 핵심 시험 99 통과 · 관련 시험 182 + 3 통과 · typecheck 0 · 서버 로그 오류 0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 12:44:47 +09:00
co-authored by Claude Opus 5.5
parent 102c993247
commit ab559c418c
8 changed files with 14 additions and 745 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ def test_흐름_길은_없고_표준_표는_남음(client: TestClient) -> None:
assert client.get("/api/m01/logic/flow", params={"key": "GF000219"}).status_code == 404
assert client.post("/api/m02/df/values", json={"items": []}).status_code == 404
got = client.get("/api/m02/df/standards").json()
assert got["unit"]["줄"] and got["money"]["줄"]
assert got["unit"]["줄"] and "money" not in got # 금액 표준 표는 894 에서 걷음(화면 0)
def test_신규_로직은_시트_줄로_자체_GX(client: TestClient) -> None:
@@ -1,75 +0,0 @@
# ruff: noqa: E501
"""값 찾기(`M02_DF_Values` · 남긴 바닥) = 옛 셈과 같은 뜻 — 마스터 읽기만.
못박는 것
- 표 블록 끝 칸 「·범위규칙」 = 줄마다 경계 말(범위규칙 첫 낱말 · 「이하 포함」 이면 맨 윗줄 이상·이하)
- 재료 값이 로직 입력(자재지역 · 계약종별)을 읽음 · 빈 단가 = 알림(blank) — 셈은 계속
- 재료 조건 찾기 field 검색어 = 옛 검색어 찾기(틀의 {자리} 를 채운 글)
"""
from __future__ import annotations
import json
from M01_MasterData import M01_MasterData_Store as store
from M02_MasterTemplete.DataFlow import M02_DF_Values as dv
def _old(key: str) -> dict:
row = store.logic(key)["logic"]
given = {k: str(v) for k, v in store.cm.시험입력(row).items()}
return {"given": given, "got": store.calc(key, given), "row": row}
def test_표_범위규칙_칸() -> None:
tables = [
t
for d in store.loaded()[0].values()
if d.get("그룹") in store.cm.mf.TABLE_GROUPS
for t in d.get("표") or []
]
ranged = [t for t in tables if "범위" in (t.get("조건") or {}).values()]
for t in ranged[:40]:
got = dv._table(str(t["키"]))
head, rows = got["rows"][0], got["rows"][1:]
assert head[-1] == dv.RANGE_RULE
first = str(t.get("범위규칙") or "초과·이하").split(" · ")[0].split(" (")[0]
assert {r[-1] for r in rows} <= {first, "이상·이하"}, t["키"]
closed = [
t
for t in ranged
if str(t.get("범위규칙") or "").startswith("이상·미만")
and "이하 포함" in str(t.get("범위규칙"))
]
for t in closed[:5]: # 맨 윗줄(위 끝이 가장 큰 줄)만 이상·이하
words = [r[-1] for r in dv._table(str(t["키"]))["rows"][1:]]
assert "이상·이하" in words and "이상·미만" in words, t["키"]
plain = next(t for t in tables if "범위" not in (t.get("조건") or {}).values())
assert dv.RANGE_RULE not in dv._table(str(plain["키"]))["rows"][0]
def test_재료는_로직_입력을_읽고_빈_단가는_알림() -> None:
old = _old("GC000685") # 모래 — 「지역: 입력」 · 입력 자재지역
line = next(x for x in old["got"]["lines"] if x["이름"] == "모래")
cond = next(x["요소"] for x in old["row"]["호표"] if x["이름"] == "모래")
assert dv._material(cond, "㎥", old["given"])["value"] == line["단가"]
alone = dv._material(cond, "㎥")
assert alone["ok"] is False and alone["blank"] is True # 입력이 없으면 그 값만 비움
def test_검색어_조건_찾기는_옛_검색어_찾기() -> None:
old = _old("GF000185") # 레미콘 {굵은골재최대치수}-{강도}-{슬럼프}
item = next(
x
for x in old["row"]["호표"]
if isinstance(x["요소"], dict) and "{" in str(x["요소"].get("검색어"))
)
want = next(x for x in old["got"]["lines"] if x["이름"] == item["이름"])["단가"]
text = store.cm.mf.fill(item["요소"]["검색어"], old["given"])
slot = {"mode": "rule", "field": "검색어", "op": "같음", "unit": item["단위"],
"scope": {k: item["요소"][k] for k in ("구분", "상세구분") if item["요소"].get(k)},
"ref": json.dumps(store._dec(item["요소"]), ensure_ascii=False, default=str), "inputs": old["given"]} # fmt: skip
assert dv.slot_price(slot, text)["value"] == want
assert dv.slot_price({**slot, "ref": None}, text)["value"] == want # 묶음 없이 범위 + 검색어
assert dv._filled("레미콘 {a}-{b}-{c}", "레미콘 25-18-080") == "레미콘 25-18-080"
assert dv._filled("싱글코아바렐 {규격}", "BX") == "싱글코아바렐 BX"