diff --git a/resources/tester/test_719_1_sk_freeze.py b/resources/tester/test_719_1_sk_freeze.py index e3d98145f..a26c78b29 100644 --- a/resources/tester/test_719_1_sk_freeze.py +++ b/resources/tester/test_719_1_sk_freeze.py @@ -86,9 +86,10 @@ def test_구조물_사본_수식_사본_값_같음_원본_지우고_고쳐도(wo assert not [r for r in _rows(bundle) if str(r.get("키")).startswith("GX9")] json.dumps(rows["참조사본"], ensure_ascii=False) # 사본 파일로 쓸 수 있는 꼴(Decimal 없음) saved = json.loads(json.dumps(bundle, ensure_ascii=False)) + formula = {"문서": source.formula_docs(rows)} # 사본 수식.json(855-F B9-6 · 로직 몫) edit(world["personal"], key, 3) # M02 에서 다시 고침 → 사본 그대로 (world["personal"] / "sangeun" / f"{key}.json").unlink() # 원본이 사라져도 사본만 봄 - got = prices.calc(rows, saved, {}, {}, None) + got = prices.calc(rows, saved, {}, {}, None, formula) line = got["줄"][0] assert not line["까닭"] for part in ("노무비", "재료비", "경비", "계"): @@ -104,7 +105,10 @@ def test_재생성은_M02_새_값(world): _, live = _top(ref) again = source.labor_doc_rows(doc) bundle = source.price_bundle(again, world["personal"]) - got = prices.calc(again, json.loads(json.dumps(bundle, ensure_ascii=False)), {}, {}, None) + formula = {"문서": source.formula_docs(again)} + got = prices.calc( + again, json.loads(json.dumps(bundle, ensure_ascii=False)), {}, {}, None, formula + ) assert got["줄"][0]["기준"]["계"] == pytest.approx(live["기준"]["계"], rel=1e-9) rid = refs.ref_id(ref["ref"]) assert first["참조사본"][rid]["수식"]["문서"] != again["참조사본"][rid]["수식"]["문서"] @@ -131,11 +135,16 @@ def test_B09_서고_사본_값_같음_원본판(world, tmp_path): assert made["만듦"] and _print(world["personal"]) == before folder = library.library_dir(root) / made["폴더"] read = {p.name: json.loads(p.read_text(encoding="utf-8")) for p in folder.glob("*.json")} - bare = prices.calc(read[source.LABOR_FILE], read[source.PRICE_FILE], {}, {}, None)["줄"][0] + labor_file, price_file, formula = ( + read[source.LABOR_FILE], + read[source.PRICE_FILE], + read["수식.json"], + ) + bare = prices.calc(labor_file, price_file, {}, {}, None, formula)["줄"][0] assert bare["기준"]["계"] == pytest.approx( live["기준"]["계"], rel=1e-9 ) # 이은 값 없음 = 저장 2 - got = prices.calc(read[source.LABOR_FILE], read[source.PRICE_FILE], {}, {}, area)["줄"][0] + got = prices.calc(labor_file, price_file, {}, {}, area, formula)["줄"][0] assert not got["까닭"] and not live["까닭"] assert got["기준"]["계"] == pytest.approx(live["기준"]["계"], rel=1e-9) mark = read["manifest.json"]["원본판"] diff --git a/resources/tester/test_848_10_upper_down.py b/resources/tester/test_848_10_upper_down.py index b5f726ef9..99686b011 100644 --- a/resources/tester/test_848_10_upper_down.py +++ b/resources/tester/test_848_10_upper_down.py @@ -177,7 +177,8 @@ def _freeze(me, key): {"이름": "t", "단위": "m", "담은로직": [{"참조": ref, "수량": {"손": 1}}]} ) bundle = source.price_bundle(rows, me) - return lambda: float(item_prices.calc(rows, bundle, {}, {})["반영합"]["계"]) + formula = {"문서": source.formula_docs(rows)} # 사본 수식.json(855-F B9-6) + return lambda: float(item_prices.calc(rows, bundle, {}, {}, None, formula)["반영합"]["계"]) def test_프로젝트_사본(world, docs_tmp): diff --git a/resources/tester/test_848_1_cover_layers.py b/resources/tester/test_848_1_cover_layers.py index dd2b6ceca..e670bd317 100644 --- a/resources/tester/test_848_1_cover_layers.py +++ b/resources/tester/test_848_1_cover_layers.py @@ -318,14 +318,17 @@ def test_SK_위덮음_내고침_되돌림_옵션_굳힘(docs_tmp, world): {"이름": "t", "단위": "m", "담은로직": [{"참조": ref, "수량": {"손": 1}}]} ) bundle = source.price_bundle(rows, me) + formula = {"문서": source.formula_docs(rows)} # 사본 수식.json(855-F B9-6) frozen = rows["참조사본"][refs.ref_id(ref)]["수식"] assert _norm(frozen[mcv.UPPER]) == _norm(upper) - was = float(item_prices.calc(rows, bundle, {}, {})["반영합"]["계"]) + was = float(item_prices.calc(rows, bundle, {}, {}, None, formula)["반영합"]["계"]) assert was == float(after["셈"]["계"]) _save_m01(_upper(d, D(2))) # 기초 고침이 바뀜 now = _at(me, path.read, key) assert float(now["셈"]["계"]) != was # 프로젝트 밖 = 지금 기초 것 - assert float(item_prices.calc(rows, bundle, {}, {})["반영합"]["계"]) == was # 사본 = 굳은 것 + assert ( + float(item_prices.calc(rows, bundle, {}, {}, None, formula)["반영합"]["계"]) == was + ) # 사본 = 굳은 것 _save_m01(upper) # ㉢ ② 를 위 층 값으로 = ② 0 now = _at(me, path.read, key)