From b67a3be75368e8dfc6c4485cc8dd98f2a9cab99d Mon Sep 17 00:00:00 2001 From: umsangdon Date: Wed, 30 Sep 2026 08:31:31 +0900 Subject: [PATCH] =?UTF-8?q?fix(M02):=20=EC=9E=AC=EC=A0=81=EC=9A=A9=20?= =?UTF-8?q?=EB=92=A4=20=EB=B3=B5=EC=82=AC=EB=B3=B8=20=E3=80=8C=EA=B3=A0?= =?UTF-8?q?=EC=B9=A8=E3=80=8D=20=EC=9D=84=20=EB=81=94=20=E2=80=94=20?= =?UTF-8?q?=EC=82=B4=EB=A6=B0=20=EC=9E=85=EB=A0=A5=EA=B0=92=20=C2=B7=20?= =?UTF-8?q?=EA=B3=A0=EB=A5=B8=20=EC=9E=90=EC=9E=AC=EB=8A=94=20=E3=80=8C?= =?UTF-8?q?=EA=B0=92=EC=9E=88=EC=9D=8C=E3=80=8D=20=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=94=B0=EB=A1=9C=20=EC=95=8C=EB=A6=BC=20=C2=B7=20=EB=AA=A9?= =?UTF-8?q?=EB=A1=9D=20=EC=A4=84=EC=97=90=EB=8F=84=20=EB=B0=98=EC=98=81=20?= =?UTF-8?q?(PLAN=2026-2b)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01BU9gbNE3aWFUvE61pS2WGt --- M02_MasterTemplete/M02_Item_Copy.py | 9 +++++++-- resources/tester/test_item_copy_complete.py | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/M02_MasterTemplete/M02_Item_Copy.py b/M02_MasterTemplete/M02_Item_Copy.py index fc40d21f..7708e664 100644 --- a/M02_MasterTemplete/M02_Item_Copy.py +++ b/M02_MasterTemplete/M02_Item_Copy.py @@ -118,6 +118,7 @@ def list_items(project_root: str | Path) -> list[dict[str, Any]]: "원본없음": changed is None, "구조물": manifest.get("구조물") or [], "고침": bool(manifest.get("고침")), + "값있음": bool(manifest.get("값있음")), } ) return out @@ -257,9 +258,13 @@ def reapply(project_root: str | Path, folder: str) -> dict[str, Any]: ] source = version_of(source_files(files)) stamp = now_text() - fresh = {**manifest, "판": source, "원본판": source, "가져온날": stamp} + # 원본을 다시 가져왔으니 시트 고침은 없음 — 살린 입력값 · 고른 자재는 `값있음` 으로 따로 알림 + kept = bool(files[VALUES_FILE] or files[PICKS_FILE]) + fresh = {**manifest, "판": source, "원본판": source, "가져온날": stamp, "고침": False} + fresh["값있음"] = kept + fresh.pop("고친날", None) atomic_write_json(target / MANIFEST_NAME, fresh) - return {"폴더": folder, "가져온날": stamp, "원본판": source, "덮임": covered} + return {"폴더": folder, "가져온날": stamp, "원본판": source, "덮임": covered, "값있음": kept} refresh = reapply # 25-1b 옛 이름(새로 가져오기) diff --git a/resources/tester/test_item_copy_complete.py b/resources/tester/test_item_copy_complete.py index 7e064363..597fc81b 100644 --- a/resources/tester/test_item_copy_complete.py +++ b/resources/tester/test_item_copy_complete.py @@ -128,6 +128,7 @@ def test_지정하면_새_파일까지_복사(world): "원본없음": False, "구조물": ["pipe@40.0"], "고침": False, + "값있음": False, } ] @@ -522,3 +523,19 @@ def test_새_항목_길_회사_없으면_409(world, monkeypatch): assert client.post("/api/projects/p1/items/new", json=body).status_code == 409 save_as = client.post("/api/projects/p1/items/f1/save-as", json={"경로": ["a"], "이름": "b"}) assert save_as.status_code == 409 + + +def test_재적용_뒤_고침은_꺼지고_값있음만_남음(world): + root = world["root"] + _save(root, [_pipe()]) + _memo(root, FOLDER, "x") + assert copies.list_items(root)[0]["고침"] is True + got = copies.reapply(root, FOLDER) + assert got["값있음"] is False + row = copies.list_items(root)[0] + assert row["고침"] is False and row["값있음"] is False + _fill_values(root) # 입력값 씀 — 고침 켜짐 + assert copies.list_items(root)[0]["고침"] is True + assert copies.reapply(root, FOLDER)["값있음"] is True + row = copies.list_items(root)[0] + assert row["고침"] is False and row["값있음"] is True