test(855-E 2-E4 ㉯-2): 옛 M01 셈 길 도우미 은퇴 · test_m01_* 를 문서 셈 · 바탕으로

- helper_855_old_engine_routes git rm — 2-E1 에서 서버에서 걷은 /calc · /text · /logic/auto 몸(시험 전용) · 부르는 곳 0
- test_m01_text git rm — 옛 계산서 글 엔진(master_text · master_copy) 자체만 봄(로직 줄 0 이면 빈 통과) · 계산서 글 = 문서 글(master_doc_text · test_855_c4_doc_text)
- test_m01_auto: 자동값 = 문서 자동값(Doc_Copy.auto_of) · 견본 금액 · 빈 줄 · 원 입력 · 체인톱 품목 = 문서 셈(셈 기록) · 고름 = Labor_Copy.line · 없는 로직 = 문서 없음(14 통과)
- test_m01_pick: 검색어 · 지역 낱말 · 고름 · 단위 환산 · 단위 경고 · 후보 없음 = master_pick.priced(문서 셈이 쓰는 바탕) · 기계 입력(목록 밖 · EQ 키) = 문서 셈 · 품목 칸 = 셈 기록
- test_m01_api: 셈 = 임시 사본 색인 문서 셈 · 저장 뒤 +40 원 · 옛 길 고유 뜻(글자 수 받기 · 모르는 입력 · 저장 전 로직 줄 시험계산) 지움 · 전력 입력 = 문서 변수
- test_m01_make: 견본 로직 줄 끝수 묶음(옛 /calc row) · check_logic 끝수 모양 검사 지움
- test_m01_cache: 목록 막힘 = 문서 막힘(master_doc_block.reasons) 전수 · 요소 지도 = 문서 막힘으로 같은 단언

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 15:15:49 +09:00
co-authored by Claude Opus 5.5
parent 2123d43773
commit 548fc3d00a
7 changed files with 144 additions and 1005 deletions
+16 -17
View File
@@ -40,6 +40,12 @@ def client(tmp_path: Path, monkeypatch) -> TestClient:
return TestClient(app)
def _mb():
import importlib
return importlib.import_module("master_doc_block")
def _logics(client: TestClient, **params) -> list[dict]:
res = client.get("/api/m01/logics", params=params)
assert res.status_code == 200, res.text
@@ -56,15 +62,12 @@ def _write(file: str, change) -> None:
def test_세어_둔_막힘이_줄마다_검사한_것과_같다(client: TestClient) -> None:
listed = _logics(client)
files, whole = store.loaded()
rows = {
str(r.get("키")): r for _, d in files.items() if d.get("그룹") == "로직" for r in d["줄"]
}
for key in parts.parts(): # 부품 문서(813-2)는 목록에서 뺌 — 키로 열기 · 셈은 그대로
rows.pop(key, None)
assert len(listed) == len(rows)
_, whole = store.loaded()
docs = store._docs().docs() # 막힘 = 수식 문서 기준(master_doc_block · 855 2-B3)
keys = {k for k in docs if k not in parts.parts()} # 부품 문서(813-2)는 목록에서 뺌
assert {x["키"] for x in listed} == keys
for one in listed:
reasons = store.cm.mf.check_logic(whole, rows[one["키"]])[0]
reasons = _mb().reasons(one["키"], docs[one["키"]], docs, whole)
assert one["reasons"] == reasons and one["blocked"] is bool(reasons)
@@ -176,13 +179,11 @@ def test_요소를_고쳐_저장해도_막힘_표시가_전수와_같다(client:
res = _save_file(client, "인력.json", [{"op": "edit", "key": "LB000014", "row": row}])
assert res.status_code == 200, res.text
listed = _logics(client)
files, whole = store.loaded()
rows = {
str(r.get("키")): r for _, d in files.items() if d.get("그룹") == "로직" for r in d["줄"]
}
_, whole = store.loaded()
docs = store._docs().docs()
assert [x["키"] for x in listed] == [x["키"] for x in was]
for one in listed:
assert one["reasons"] == store.cm.mf.check_logic(whole, rows[one["키"]])[0]
assert one["reasons"] == _mb().reasons(one["키"], docs[one["키"]], docs, whole)
def test_요소_지도가_전수_검사와_같다(client: TestClient) -> None:
@@ -199,8 +200,6 @@ def test_요소_지도가_전수_검사와_같다(client: TestClient) -> None:
marked = {key for key, got in counts.items() if got[2] & marks}
empty = {**files, "인력.json": {**files["인력.json"], "줄": []}}
other = store.cm.mf.Master(empty)
rows = {
str(r.get("키")): r for _, d in files.items() if d.get("그룹") == "로직" for r in d["줄"]
}
changed = {k for k, r in rows.items() if store.cm.mf.check_logic(other, r)[0] != counts[k][0]}
docs = store._docs().docs()
changed = {k for k, d in docs.items() if _mb().reasons(k, d, docs, other) != counts[k][0]}
assert changed and changed <= marked