diff --git a/resources/tester/test_794_1b_flow_gone.py b/resources/tester/test_794_1b_flow_gone.py index ae87eac78..42a3680ef 100644 --- a/resources/tester/test_794_1b_flow_gone.py +++ b/resources/tester/test_794_1b_flow_gone.py @@ -69,9 +69,3 @@ def test_신규_로직은_시트_줄로_자체_GX(client: TestClient) -> None: assert len(added) == 1 and added[0]["key"].startswith("GX") saved = client.get("/api/m01/logic", params={"key": added[0]["key"]}).json()["logic"] assert saved["구분"] == "자체" and saved["이름"] == "sub3임시 새 로직" and "흐름" not in saved - - -def test_흐름이_남은_줄은_까닭으로_막음() -> None: - mf = store.cm.mf - with pytest.raises(mf.FormulaError, match="흐름도 로직은 걷음"): - mf.inputs_of({"흐름": {"boxes": [], "links": []}}) diff --git a/resources/tester/test_822_2_machine_hourly_all.py b/resources/tester/test_822_2_machine_hourly_all.py index 2486cf1cf..fc083bdfe 100644 --- a/resources/tester/test_822_2_machine_hourly_all.py +++ b/resources/tester/test_822_2_machine_hourly_all.py @@ -23,7 +23,7 @@ from fastapi.testclient import TestClient from common_util import common_util_auth as auth from M01_MasterData import M01_MasterData_Router as router_module from M01_MasterData import M01_MasterData_Store as m01 -import helper_855_old_engine_routes as old_engine # noqa: E402 — 옛 셈 몸(855 2-E1 · 시험 전용) +import helper_855_engine as h_doc # noqa: E402 — 문서 셈 한 번(옛 엔진 자리 · 855-E 2-E4) from M02_MasterTemplete import M02_Labor_Inputs as li from M02_MasterTemplete import M02_Labor_Ref as refs from M02_MasterTemplete import M02_Machine_Hourly as mh @@ -183,7 +183,7 @@ def test_direct_formula_my_machine(world): assert made["시간당"]["로직"] == DIRECT and made["시간당"]["계"] == 60 no = made["줄"]["원문번호"] whole = _at(me, mym.whole) - run = m01.cm.mf.run(whole, DIRECT, {"기계": no}) # 직접 값 식 — 내 기계 원문번호를 받음 + run = h_doc.calc(DIRECT, {"기계": no}, whole) # 직접 값 식 — 내 기계 원문번호를 받음 assert (run["노무비"], run["재료비"], run["경비"]) == (10, 20, 30) body = { "이름": NAME, @@ -221,8 +221,8 @@ def test_power_line_jumbo_drill(): h["경비"], h["계"], ) - home = old_engine.calc(POWER_CREW, {"기계": "5805-0002", "전력 계약종별": "주택용 저압"}) - assert home["ok"] and float(home["sums"]["재료비"]) > h["재료비"] # 120 원/kWh > 114.4 + home = h_doc.calc(POWER_CREW, {"기계": "5805-0002", "전력 계약종별": "주택용 저압"}) + assert home["셈됨"] and float(home["재료비"]) > h["재료비"] # 120 원/kWh > 114.4 def test_power_my_machine(world): diff --git a/resources/tester/test_item_copy_complete.py b/resources/tester/test_item_copy_complete.py index de8f9a718..2694d380e 100644 --- a/resources/tester/test_item_copy_complete.py +++ b/resources/tester/test_item_copy_complete.py @@ -190,26 +190,13 @@ def test_입력이_없으면_빠진_입력_목록_셈은_자동값(world): assert _stuck(got) == [] and got["기준합"]["계"] > 0 -def test_마스터_단가를_바꿔도_계산_그대로_새로_가져오면_바뀜(world, monkeypatch): - from M02_MasterTemplete import M02_Labor_Doc as labor_doc - - monkeypatch.setattr(labor_doc, "apart", lambda one: False) # M01 조합 셈과 대조(222-1 안 뺌) +def test_마스터_단가를_바꿔도_계산_그대로_새로_가져오면_바뀜(world): + """옛 M01 조합 엔진(`master_combo.run`) 대조는 855-E 2-E4 에서 은퇴 — 사본 셈 = 층 셈 한 벌.""" root, master_dir = world["root"], world["master"] _save(root, [_pipe()]) values = _fill_values(root) before = copies.calc(root, FOLDER) assert before["빠진입력"] == [] and _stuck(before) == [] and before["기준합"]["계"] > 0 - files, whole = m01.loaded() - ua = next( - r - for d in files.values() - if d.get("그룹") == "일위대가조합" - for r in d["줄"] - if r["키"] == "UA000036" - ) - given = {k: {n: v["값"] for n, v in one.items()} for k, one in values.items()} - expected = prices.to_json(prices.mcb.run(whole, ua, given)) - assert before["기준합"]["계"] == pytest.approx(expected["계"]) assert before["기준합"]["노무비"] > 0 labor_file = master_dir / "인력.json" original = labor_file.read_bytes() diff --git a/resources/tester/test_m02_labor_layer.py b/resources/tester/test_m02_labor_layer.py index 13c860a63..03ab8641c 100644 --- a/resources/tester/test_m02_labor_layer.py +++ b/resources/tester/test_m02_labor_layer.py @@ -74,7 +74,9 @@ def test_율_정리() -> None: def test_문서_계산과_프로젝트_사본_같음() -> None: doc = labor.clean({"단위": "㎡", "담은로직": [{"로직": CODE, "켜쌓기율": 90}]}) whole = m01.loaded()[1] - auto = m01.mau.values(whole, whole.logic(CODE)) + from M02_MasterTemplete import M02_Doc_Copy as dc + + auto = dc.auto_of(dc.doc_of(whole, CODE), whole) # 문서 자동값(옛 master_auto 와 같음) values = {CODE: {k: {"값": labor._json(v), "확인": True} for k, v in auto.items()}} copy = {"줄": doc, "알약": labor.pills(doc)} got = prices.calc(copy, prices.to_json(prices.collect([CODE])), values, {})