From 1877d4ee674b57c91c93a2c2acff939830e23b6c Mon Sep 17 00:00:00 2001 From: umsangdon Date: Wed, 18 Nov 2026 08:40:45 +0900 Subject: [PATCH] =?UTF-8?q?test(855-F=20B9-6):=20B08=20=C2=B7=20B09=20?= =?UTF-8?q?=EC=82=AC=EB=B3=B8=20=EA=B2=AC=EB=B3=B8=EC=9D=84=20=EC=83=88=20?= =?UTF-8?q?=EA=BC=B4=EB=A1=9C=20=E2=80=94=20=EC=88=98=EC=8B=9D.json=20+=20?= =?UTF-8?q?=EC=9E=90=EC=9B=90=20=EC=A4=84=20=EB=8B=A8=EA=B0=80.json(?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=A4=84=20=EC=97=86=EC=9D=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 저장소 사본 전수 = 0(단가.json · 수식.json · 일위대가.json 사본 파일 없음) — 옛 꼴(단가.json 에 로직 줄 · 수식.json 없음) 사본은 견본에만 있어 실제 build_source 꼴로 바꿈 - test_145_2.copy_files(로직 키 → 수식.json 닫힌 문서 + Item_Bundle.collect 단가.json) 한 곳 · 145_2 _snap · 144 · 155 · 166_2 · 705_1 이 씀 - 검증: 바꾼 다섯 파일 38 통과 Co-Authored-By: Claude Opus 5.5 --- resources/tester/test_144_b09_skeleton.py | 5 ++--- resources/tester/test_145_2_b09_labor_calc.py | 21 +++++++++++++------ resources/tester/test_155_b09_sources.py | 3 +-- resources/tester/test_166_2_b09_bill_hand.py | 4 ++-- resources/tester/test_705_1_fixed_line.py | 3 ++- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/resources/tester/test_144_b09_skeleton.py b/resources/tester/test_144_b09_skeleton.py index 08be64184..5e5bb8f76 100644 --- a/resources/tester/test_144_b09_skeleton.py +++ b/resources/tester/test_144_b09_skeleton.py @@ -116,11 +116,10 @@ def test_연결_없으면_빈_표와_연결_없음(tmp_path, monkeypatch): def test_연결된_사본이_부른_자원만(tmp_path): """사본 단가 묶음 통째(고르기 후보 기계 100여)가 아니라 로직이 실제로 부른 줄만.""" from B09_Estimation.B09_Estimation_Linked import used_keys - from M02_MasterTemplete import M02_Item_Prices as item_prices + from resources.tester.test_145_2_b09_labor_calc import copy_files - bundle = item_prices.to_json(item_prices.collect(["GC000268"])) # 기계 시간당 기계경비 files = { - "단가.json": bundle, + **copy_files(["GC000268"]), # 기계 시간당 기계경비 · 사본 = 수식 문서 + 자원 줄(855-F B9-6) "일위대가.json": {"줄": {"종류": "일위대가", "담은로직": [{"로직": "GC000268"}]}}, "입력값.json": {"GC000268": {"기계": {"값": "0101-0019"}, "지역": {"값": "전국평균"}}}, } diff --git a/resources/tester/test_145_2_b09_labor_calc.py b/resources/tester/test_145_2_b09_labor_calc.py index 06ecb9edd..ace32872e 100644 --- a/resources/tester/test_145_2_b09_labor_calc.py +++ b/resources/tester/test_145_2_b09_labor_calc.py @@ -250,6 +250,19 @@ def _values(given): return {"GF000219": {k: {"값": v} for k, v in given.items()}} +def copy_files(codes, materials=None) -> dict: + """사본 셈 파일 견본 — `수식.json`(로직 키 닫힌 문서) + `단가.json`(그 문서 · 자재가 잇는 자원 줄 · + 로직 줄 없음 · 855-F B9-6 · `M02_Item_Source.build_source` 꼴).""" + from M02_MasterTemplete import M02_Doc_Copy as dc + from M02_MasterTemplete import M02_Item_Bundle as item_bundle + + docs = dc.closure(item_prices.master()[1], codes) + return { + "수식.json": item_prices.to_json({"그룹": "수식문서", "문서": docs}), + "단가.json": item_prices.to_json(item_bundle.collect(docs, materials)), + } + + def _snap(root, owner, key, lines, values, copies=None): folder = snapshots.structures_dir(root) / snapshots.folder_name(owner) folder.mkdir(parents=True) @@ -260,12 +273,8 @@ def _snap(root, owner, key, lines, values, copies=None): for doc in (copies or {}).values(): codes += [one["로직"] for one in doc["담은로직"] if "로직" in one] write(snapshots.MANIFEST_NAME, {"원본": {**_item(key), "경로": ["기슭막이", key]}}) - from M02_MasterTemplete import M02_Doc_Copy as dc - from M02_MasterTemplete import M02_Item_Bundle as item_bundle - - docs = dc.closure(item_prices.master()[1], codes) # 사본 = 수식 문서 + 자원 줄(855-F B9-6) - write("수식.json", item_prices.to_json({"그룹": "수식문서", "문서": docs})) - write("단가.json", item_prices.to_json(item_bundle.collect(docs))) + for name, data in copy_files(codes).items(): + write(name, data) doc = {"종류": "일위대가", "단위": "m", "담은로직": lines, "자재": []} write("일위대가.json", {"줄": doc, **({"참조사본": copies} if copies else {})}) write("입력값.json", values) diff --git a/resources/tester/test_155_b09_sources.py b/resources/tester/test_155_b09_sources.py index 54791d24b..7a8b56536 100644 --- a/resources/tester/test_155_b09_sources.py +++ b/resources/tester/test_155_b09_sources.py @@ -23,7 +23,6 @@ from B09_Estimation.B09_Estimation_Calc_Labor import compute_labor # noqa: E402 from B09_Estimation.B09_Estimation_Labor_Source import daega_inputs # noqa: E402 from B09_Estimation.B09_Estimation_Linked import linked_resource_keys # noqa: E402 from B09_Estimation.B09_Estimation_Router import compute_sheets # noqa: E402 -from M02_MasterTemplete import M02_Item_Prices as item_prices # noqa: E402 PILE = "GF000233" # 말뚝 다듬기 — 원/10개(배 10) · 인력 줄 둘 PIPE = "GF000174" # 흄관 부설 — 하위 로직 줄(GF000155 · GF000160) = 하위 산근 @@ -83,7 +82,7 @@ def test_155_4_산근_자재_자리표시_키_대비표로(tmp_path): folder = tmp_path / "a" folder.mkdir() files = { - "단가.json": item_prices.to_json(item_prices.collect([FUEL])), + **t145.copy_files([FUEL]), # 사본 = 수식 문서 + 자원 줄(855-F B9-6) "일위대가.json": {"줄": {"종류": "일위대가", "담은로직": [{"로직": FUEL}]}}, "입력값.json": {}, } diff --git a/resources/tester/test_166_2_b09_bill_hand.py b/resources/tester/test_166_2_b09_bill_hand.py index 983b62914..99ca94eeb 100644 --- a/resources/tester/test_166_2_b09_bill_hand.py +++ b/resources/tester/test_166_2_b09_bill_hand.py @@ -22,7 +22,7 @@ from B09_Estimation import B09_Estimation_Sangeun as sg # noqa: E402 from B09_Estimation.B09_Estimation_Calc_Bill import WHY_LOGIC, compute_estimation # noqa: E402 from B09_Estimation.B09_Estimation_Store import clean_user # noqa: E402 from B09_Estimation.B09_Estimation_Summary import compute_summary, hopyo_lines # noqa: E402 -from M02_MasterTemplete import M02_Item_Prices as item_prices # noqa: E402 +from resources.tester.test_145_2_b09_labor_calc import copy_files # noqa: E402 IMPORTS = re.compile(r"^import[^;]*;\n", re.MULTILINE) STONE = "GF000219" # 돌쌓기 메쌓기(인력) — 석공 0.195 · 보통인부 0.156 / ㎡ @@ -156,7 +156,7 @@ def test_저장_다듬기_bill(): def _snapshot(folder: Path, rows, values=None) -> Path: folder.mkdir(parents=True, exist_ok=True) files = { - "단가.json": item_prices.to_json(item_prices.collect([STONE, NET])), + **copy_files([STONE, NET]), # 사본 = 수식 문서 + 자원 줄(855-F B9-6) "일위대가.json": {"줄": {"종류": "일위대가", "담은로직": rows}}, "입력값.json": {k: {n: {"값": v} for n, v in d.items()} for k, d in (values or {}).items()}, } diff --git a/resources/tester/test_705_1_fixed_line.py b/resources/tester/test_705_1_fixed_line.py index d52cbf7d9..4565c4f1e 100644 --- a/resources/tester/test_705_1_fixed_line.py +++ b/resources/tester/test_705_1_fixed_line.py @@ -209,7 +209,8 @@ def _snap(root, owner, key, lines): doc = labor.clean({"단위": "m", "담은로직": lines}) codes = [one["로직"] for one in lines if "로직" in one] write(snapshots.MANIFEST_NAME, {"원본": {**b145._item(key), "경로": ["기슭막이", key]}}) - write("단가.json", item_prices.to_json(item_prices.collect(codes, fixed.link_keys(doc)))) + for name, data in b145.copy_files(codes, fixed.link_keys(doc)).items(): # 855-F B9-6 + write(name, data) write("일위대가.json", {"줄": doc}) write("입력값.json", b145._values(b145.STONE))