Files
Aislo/resources/tester/test_855_l2b_copy_plain.py
T
eomsangdonandClaude Opus 5.5 2123d43773 test(855-E 2-E4 ㉯-1): 로직 JSON 걷은 뒤 깨진 시험 셋 묶음 — 782 check_master · 713_4 · 855_l2b
- helper_855_engine.master_files(이름들) = check_master.load 꼴 · 옛 로직 파일 이름 = 같은 장 수식 문서 줄(M01_MasterData_Doc.logic_files)
- test_782_1 · 782_2 · 782_3: check_master 시험 = 로직 파일 대신 문서 줄 · 옛 check_logics → check_docs(문서 막힘 · 키 겹침 · 연결) · 목차 대조(check_master_toc) = 문서 줄로 그대로 · 782_3 장 끝 셈 = 문서 기본 입력 셈 됨(옛 시험입력 걷힘)
- test_713_4: 조종원 세 계수 = 수식 문서 글 · 옛 로직 일괄 시험계산(calc_all · 걷힘) 단언 지움
- test_855_l2b_copy_plain: 옛 저장본 로직 줄 = 손 견본(로직 JSON 없음)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 14:59:50 +09:00

52 lines
2.2 KiB
Python

# ruff: noqa: F811 — 임시 층 fixture(world)를 test_m02_labor_ref 에서 받아 씀
"""855 L2 ⓑ-1 — 단가산출 값 사본에 M01 로직 줄(GF · GC · GX)을 안 담음 · 옛 저장본의 로직 줄은 안 읽음 ·
일위대가(SC) 값 사본도 로직 줄 안 담음(B9-6 — 프로젝트 사본 묶음이 수식 부름 문서를 읽음).
임시 storage · 개인 층. 셈 = 수식 문서 사본(`부름`) · 로직 줄 값 사본이 없어도 금액 같음.
"""
from __future__ import annotations
import copy
from decimal import Decimal
from M01_MasterData import M01_MasterData_Store as m01
from M02_MasterTemplete import M02_MasterTemplete_Store as store
from M02_MasterTemplete import M02_Sangeun_Calc as calc
from M02_MasterTemplete import M02_Sangeun_Copy as skc
from resources.tester.test_795_1_sk_copy import _doc, _sk
from resources.tester.test_795_2_sc_copy import PCT, _read, _sc
from resources.tester.test_m02_labor_ref import world # noqa: F401 — 같은 임시 층
def _logic_rows(doc: dict) -> list[str]:
rows = [r for slot in ("수식", "사본") for r in ((doc.get(slot) or {}).get("로직") or [])]
return [str(r["키"]) for r in rows if str(r["키"])[:2] in skc.LOGIC]
def _sum(folder, doc) -> Decimal:
with store.at(folder):
return Decimal(str(calc.run(doc, m01.loaded()[1])["기준"]["계"]))
def test_저장본에_로직줄_없음_금액_같음(world):
me = world["personal"]
sk = _doc(me, _sk(me, 바탕={"로직": PCT}))
sc = _read(me, "precombo", _sc(me, [{"로직": PCT, "수량": {"손": 1}}]))
assert _logic_rows(sk) == [] and _logic_rows(sc) == []
assert _sum(me, sk) > 0
def test_옛_저장본_로직줄은_안_읽음(world):
me = world["personal"]
sk = _doc(me, _sk(me, 바탕={"로직": PCT}))
was = _sum(me, sk)
old = copy.deepcopy(sk) # 옛 꼴 — 값 사본에 바탕 로직 줄(값을 틀리게 바꾼 것)
row = { # 옛 로직 줄 꼴(로직 JSON 걷은 뒤 855-E L3 — 견본만)
"키": PCT,
"호표": [{"종류": "인력", "요소": "LB000002", "수량": "1", "비목": "노무비"}],
}
old["수식"]["로직"] = [*old["수식"]["로직"], row]
assert skc.held(old)["로직"] == skc.held(sk)["로직"]
assert _sum(me, old) == was