From b155ef8adf2159792e976c7656e8f3e679d6a360 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Wed, 18 Nov 2026 13:30:03 +0900 Subject: [PATCH] =?UTF-8?q?test(855-E=20L3=20=EB=AF=B8=EB=A6=AC):=20?= =?UTF-8?q?=EC=9D=BC=EC=9C=84=EB=8C=80=EA=B0=80=20=C2=B7=20=EC=82=AC?= =?UTF-8?q?=EC=A0=84=EC=A1=B0=ED=95=A9=20=C2=B7=20B09=20=EC=82=AC=EB=B3=B8?= =?UTF-8?q?=20=E3=80=8CM01=20=EB=B0=94=EB=80=9C=E3=80=8D=20=ED=9D=89?= =?UTF-8?q?=EB=82=B4=EB=A5=BC=20=EC=88=98=EC=8B=9D=20=EB=AC=B8=EC=84=9C?= =?UTF-8?q?=EB=A1=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit L3 둘째 박자(sub7 9847aa3d6)가 Doc_Copy 의 로직 줄 변환기(dc.cv)를 걷어 깨진 견본(브레인 넘김 여덟 가운데 넷). - test_795_1 도우미 `_fake` — 옛 로직 줄 변환 갈래 지움 · `_changed` = 기초 문서 금액 줄 수량 × 2 만 - test_795_2 셋 · test_795_4 하나 — M01 바뀜 = `_changed(_m01_doc(PCT))`(뜻 그대로: 사본 금액 · 판 지문 · TS 거울 · B09 묶음 굳힘) - test_795_2 다른 줄 하나 = ruff format 이 접은 것(뜻 같음) 지금 판 · 없는 판 둘 다 통과(795_1 · 795_2 · 795_4 · 802_4a · 804_4 · 855_2d 35) · 관련 25 파일 207 통과(717_2a 하나 = 앞 커밋에 적은 지금 판 실패) Co-Authored-By: Claude Opus 5.5 --- resources/tester/test_795_1_sk_copy.py | 16 ++++++---------- resources/tester/test_795_2_sc_copy.py | 12 +++++++----- resources/tester/test_795_4_b09_copy.py | 4 ++-- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/resources/tester/test_795_1_sk_copy.py b/resources/tester/test_795_1_sk_copy.py index 4cac81af3..97c8600e5 100644 --- a/resources/tester/test_795_1_sk_copy.py +++ b/resources/tester/test_795_1_sk_copy.py @@ -50,7 +50,7 @@ def _m01_doc(key): def _fake(monkeypatch, rows=(), drop=()): """M01 바꿈 흉내 — 지금 색인 위에 바뀐 요소 줄 · 바뀐 기초 수식 문서(`금액` 있는 것) · 지운 키 - (정본 파일 안 고침 · 802-4a 수식 사본 SK 의 M01 정본 = 수식 문서 · 옛 로직 줄은 그 줄 변환 문서로).""" + (정본 파일 안 고침 · 기초 정본 = 수식 문서 · 855 L3 로직 줄 · 변환기 안 씀).""" from M02_MasterTemplete import M02_Doc_Copy as dc changed = {str(r["키"]): copy.deepcopy(r) for r in rows if "금액" in r} @@ -70,7 +70,6 @@ def _fake(monkeypatch, rows=(), drop=()): fake.index.get(key[:2], {}).pop(key, None) monkeypatch.setattr(m01, "loaded", lambda: (files, fake)) docs = {k: v for k, v in dc.folder().items() if k not in drop} | changed - docs |= {str(r["키"]): dc.cv.convert(fake, copy.deepcopy(r))[0] for r in rows if "호표" in r} monkeypatch.setattr(dc, "folder", lambda: docs) return fake @@ -100,14 +99,11 @@ def _sum(folder, key): return _calc(folder, _doc(folder, key))["기준"]["계"] -def _changed(row, at=0): - """기초 줄 하나 수량 × 2 — 수식 문서(`금액` 줄 · 855 L3) · 옛 로직 줄(`호표`).""" - row = copy.deepcopy(row) - if "금액" in row: - row["금액"][at]["수량"] = f"({row['금액'][at]['수량']}) × 2" - return row - row["호표"][at]["수량"] = f"({row['호표'][at]['수량']}) * 2" - return row +def _changed(doc, at=0): + """기초 문서 금액 줄 하나 수량 × 2(855 L3 — 옛 = 로직 호표 줄).""" + doc = copy.deepcopy(doc) + doc["금액"][at]["수량"] = f"({doc['금액'][at]['수량']}) × 2" + return doc def test_copy_stamped_and_logic_change_kept(world, monkeypatch): diff --git a/resources/tester/test_795_2_sc_copy.py b/resources/tester/test_795_2_sc_copy.py index a3da6c9ed..e32f7ebdc 100644 --- a/resources/tester/test_795_2_sc_copy.py +++ b/resources/tester/test_795_2_sc_copy.py @@ -20,7 +20,7 @@ from M02_MasterTemplete import M02_Labor_Ref as refs from M02_MasterTemplete import M02_MasterTemplete_Store as store from M02_MasterTemplete import M02_Sangeun_Copy as skc from resources.tester.helper_855_line import run_line -from resources.tester.test_795_1_sk_copy import _changed, _fake, _live +from resources.tester.test_795_1_sk_copy import _changed, _fake, _live, _m01_doc from resources.tester.test_m02_labor_calc_mirror import _same, _ts from resources.tester.test_m02_labor_ref import world # noqa: F401 — 같은 임시 층 @@ -83,11 +83,13 @@ def test_copy_stamped_logic_change_kept(world, monkeypatch): sc = _sc(me, [{"로직": PCT, "수량": {"손": 1}}]) doc = _labor(me, [{"로직": PCT, "수량": {"손": 2}}]) for got in (doc, _read(me, "precombo", sc)): - assert PCT in got["수식"]["부름"] # 로직 몫 = 수식 부름 문서(값 사본 로직 줄 없음 · 855-E 2-E4) + assert ( + PCT in got["수식"]["부름"] + ) # 로직 몫 = 수식 부름 문서(값 사본 로직 줄 없음 · 855-E 2-E4) assert LB in {r["키"] for r in skc.held(got)["단가"]} was = (_calc(me, COL)["반영합"]["계"], _calc(me, sc)["기준합"]["계"], _unit(me, sc)) assert _calc(me, COL)["사본"]["M01새판"] is False - _fake(monkeypatch, [_changed(_live().logic(PCT))]) + _fake(monkeypatch, [_changed(_m01_doc(PCT))]) assert run_line(m01.loaded()[1], PCT, {})["기준"]["계"] != was[2] # M01 셈은 바뀜 now = (_calc(me, COL)["반영합"]["계"], _calc(me, sc)["기준합"]["계"], _unit(me, sc)) assert now == was @@ -116,7 +118,7 @@ def test_layer_and_column_copy_keep_copy(world, monkeypatch): src = _sc(co, [{"로직": PCT, "수량": {"손": 1}, "패치": COVER}]) first = skc.held(_read(co, "precombo", src)) old_doc = _labor(me, [{"로직": PCT, "수량": {"손": 2}}]) # 받는 열 = 옛 M01 사본 - _fake(monkeypatch, [_double(LB), _changed(_live().logic(PCT))]) + _fake(monkeypatch, [_double(LB), _changed(_m01_doc(PCT))]) ref = {"층": "company", "주인": "7", "키": src} with store.at(me): got = refs.create( @@ -139,7 +141,7 @@ def test_ts_mirror_same_amount(world, monkeypatch): doc = _labor(me, [{"로직": PCT, "수량": None}]) with store.at(me): before = labor.calc(labor.clean(doc), {}) - _fake(monkeypatch, [_double(LB), _changed(_live().logic(PCT))]) + _fake(monkeypatch, [_double(LB), _changed(_m01_doc(PCT))]) with store.at(me): clean = labor.clean(_read(me, "labor", COL)) answer = labor.calc(clean, {}) diff --git a/resources/tester/test_795_4_b09_copy.py b/resources/tester/test_795_4_b09_copy.py index 97f3ac7f5..c25ced794 100644 --- a/resources/tester/test_795_4_b09_copy.py +++ b/resources/tester/test_795_4_b09_copy.py @@ -25,7 +25,7 @@ from M02_MasterTemplete import M02_Item_Prices as item_prices from M02_MasterTemplete import M02_Item_Source as source from M02_MasterTemplete import M02_Sangeun_Copy as skc from resources.tester.test_145_2_b09_labor_calc import _project, _snap -from resources.tester.test_795_1_sk_copy import _changed, _fake, _live +from resources.tester.test_795_1_sk_copy import _changed, _fake, _live, _m01_doc from resources.tester.test_795_2_sc_copy import LB, PCT, _double, _labor from resources.tester.test_m02_labor_ref import world # noqa: F401 — 같은 임시 층 @@ -65,7 +65,7 @@ def test_bundle_is_m02_copy_then_frozen(world, monkeypatch): rows = source.labor_doc_rows(doc) was = _amount(rows, _copy(rows, me)) # 지금 M01 = 사본 만든 때 bundle = _copy(rows, me) - _m01(monkeypatch, [_changed(_live().logic(PCT)), _double(LB)]) + _m01(monkeypatch, [_changed(_m01_doc(PCT)), _double(LB)]) assert _amount(rows, bundle) == was # 굳힌 묶음 = M01 안 읽음 late = _copy(source.labor_doc_rows(doc), me) # 구조물 지정이 M01 바뀐 뒤 assert _amount(rows, late) == was # M02 사본 = 만든 때