diff --git a/resources/tester/test_717_2a_sangeun_list.py b/resources/tester/test_717_2a_sangeun_list.py index ca3db3416..e08d30a40 100644 --- a/resources/tester/test_717_2a_sangeun_list.py +++ b/resources/tester/test_717_2a_sangeun_list.py @@ -27,7 +27,9 @@ def _row(folder, kind, key): def test_sangeun_row_base_edits_users(world): mine = world["personal"] a = _sk(mine, 바탕={"로직": PCT}, 덮개={"labor:LB000036#0": {"qty": 0.5}}, 뺀줄=["pct:x#0"]) - name = m01.loaded()[1].logic(PCT)["이름"] + from M01_MasterData import M01_MasterData_Doc as m01_doc + + name = m01_doc.docs()[PCT]["이름"] # 기초 이름 = 수식 문서(855 L3) row = _row(mine, "sangeun", a) assert row["바탕"] == f"{PCT} {name}".strip() assert row["고친줄수"] == 2 and row["쓰는곳수"] == 0 diff --git a/resources/tester/test_822_2_machine_hourly_all.py b/resources/tester/test_822_2_machine_hourly_all.py index f6ad1d966..2486cf1cf 100644 --- a/resources/tester/test_822_2_machine_hourly_all.py +++ b/resources/tester/test_822_2_machine_hourly_all.py @@ -38,7 +38,10 @@ import master_machine_coef as mc # noqa: E402 import master_machine_crew as mcrew # noqa: E402 import master_doc_link as mdl # noqa: E402 -MACHINE, LOGIC = "기계.json", "로직_건설품셈_08장_건설기계.json" +MACHINE, LOGIC = ( + "기계.json", + "수식문서/수식_건설품셈_08장_건설기계.json", +) # 꼴 식 = 수식 문서(855 L3) POWER, POWER_CREW, ONE_FUEL, DIRECT = "GC001196", "GC001197", "GC001198", "GC001199" FUEL_POWER, FUEL_POWER_CREW = "GC001200", "GC001201" NAME = "sub1임시기계822" @@ -58,8 +61,9 @@ def _wage(job: str) -> Decimal: def _codes(key: str) -> list[str]: - row = next(r for r in m01.read(LOGIC)[0]["줄"] if r["키"] == key) - return [str(c) for c in next(i for i in row["입력"] if i["이름"] == "기계").get("고르기", [])] + doc = mdl.load_all(mdl.FOLDER)[key] # 기계 고르기 정본 = 문서 선택 목록(855 L3 ⓐ) + pick = next(v for v in doc["변수"] if v.get("열쇠") == "기계") + return [str(c) for c in (pick.get("연결") or {}).get("목록") or []] # ① · ② ─────────────────────────────────────────────────────────────── diff --git a/resources/tester/test_m02_item_labor.py b/resources/tester/test_m02_item_labor.py index 9d4eab6ef..bf79886c9 100644 --- a/resources/tester/test_m02_item_labor.py +++ b/resources/tester/test_m02_item_labor.py @@ -57,8 +57,11 @@ def _write(path: Path, content: Any) -> None: def _first_input(code: str) -> tuple[str, Any]: - whole = m01.loaded()[1] - name, value = next(iter(m01.mau.values(whole, whole.logic(code)).items())) + from M01_MasterData import M01_MasterData_Doc as m01_doc + from M02_MasterTemplete import M02_Doc_Copy as dc + + whole = m01.loaded()[1] # 자동값 = 수식 문서 변수(855 L3 · 옛 mau 와 같은 값) + name, value = next(iter(dc.auto_of(m01_doc.docs()[code], whole).items())) return name, int(value) if isinstance(value, Decimal) and value % 1 == 0 else value @@ -122,9 +125,12 @@ def _fill_auto(root: Path) -> None: """빠진 입력을 자동값으로(확인 참) — 문서 입력값은 그대로 둠.""" current = copies.read_file(root, FOLDER, "입력값") values = current["내용"] + from M01_MasterData import M01_MasterData_Doc as m01_doc + from M02_MasterTemplete import M02_Doc_Copy as dc + whole = m01.loaded()[1] - for code in LOGICS: - for key, auto in m01.mau.values(whole, whole.logic(code)).items(): + for code in LOGICS: # 자동값 = 수식 문서 변수(855 L3) + for key, auto in dc.auto_of(m01_doc.docs()[code], whole).items(): mine = values.setdefault(code, {}) if key not in mine and auto is not None: mine[key] = {"값": labor_doc._json(auto), "확인": True} diff --git a/resources/tester/test_m02_labor_mat_marks.py b/resources/tester/test_m02_labor_mat_marks.py index a59752ae9..8ead75d24 100644 --- a/resources/tester/test_m02_labor_mat_marks.py +++ b/resources/tester/test_m02_labor_mat_marks.py @@ -31,10 +31,10 @@ def _doc(**extra): def _first_non_material(code): - from M01_MasterData import M01_MasterData_Store as m01 + from M01_MasterData import M01_MasterData_Doc as m01_doc - rows = m01.loaded()[1].logic(code).get("호표") or [] - return next(n for n, r in enumerate(rows) if r.get("종류") != "재료") + lines = m01_doc.docs()[code].get("금액") or [] # 기초 줄 = 수식 문서 금액 줄(855 L3) + return next(n for n, line in enumerate(lines) if line.get("비목") != "재료비") def test_사용자_자재_허용_값만():