From d0d287c4be1ca144e5ffc1ad11100020d61acddd Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 22 Sep 2026 02:30:38 +0900 Subject: [PATCH] =?UTF-8?q?=EF=BB=BFtest(M01):=20=EC=A1=B0=ED=95=A9=20?= =?UTF-8?q?=EC=8B=9C=ED=97=98=EC=9D=B4=20=EC=A0=95=EB=B3=B8=20=EA=B2=AC?= =?UTF-8?q?=EB=B3=B8=20=EC=A1=B0=ED=95=A9=EC=97=90=20=EC=95=88=20=EA=B9=A8?= =?UTF-8?q?=EC=A7=80=EA=B2=8C=20=E2=80=94=20=EC=82=AC=EB=B3=B8=20=EC=A1=B0?= =?UTF-8?q?=ED=95=A9=20=EC=A4=84=EC=9D=84=20=EB=B9=84=EC=9B=8C=20=EC=8B=9C?= =?UTF-8?q?=EC=9E=91=20(=EC=9D=BC=EA=B0=90=2030)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01V1MKKZKpUHTPKb513FneU8 --- resources/tester/test_m01_combo.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/resources/tester/test_m01_combo.py b/resources/tester/test_m01_combo.py index dbca8ef9..36349715 100644 --- a/resources/tester/test_m01_combo.py +++ b/resources/tester/test_m01_combo.py @@ -5,11 +5,12 @@ - 조합은 이름과 담은 로직 목록만 지님 — 수량·비율·계산 칸을 두지 않음. - 미리 보기 합계 = 담은 로직 저마다의 시험 계산을 비목별로 더한 값(저장 없음). - 검사 — 없는 로직 키 · 같은 로직 두 번 · 빈 조합 · 조합이 조합을 담음. - - 견본 조합은 시험에서만 만들고 정본 파일에는 넣지 않음(정본은 빈 채로 둠). + - 시험은 임시 사본에서 돌고, 사본의 조합 줄은 비워 시작 — 정본에 견본 조합이 있어도 없어도 같음. """ from __future__ import annotations +import json import shutil import sys from decimal import Decimal @@ -38,6 +39,10 @@ def client(tmp_path: Path, monkeypatch) -> TestClient: for path in REAL.glob("*.json"): if not path.name.startswith("_") or path.name == store.mk.BOOK.name: shutil.copy(path, tmp_path / path.name) + own = tmp_path / mcb.FILE # 정본의 견본 조합이 시험 줄 수에 끼지 않게 사본은 비워 시작 + data = json.loads(own.read_text(encoding="utf-8")) + data["줄"] = [] + own.write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8") monkeypatch.setattr(store, "FOLDER", tmp_path) app = FastAPI() app.include_router(router_module.router) @@ -80,10 +85,11 @@ def _make(client: TestClient, keys=SAMPLE, 이름="돌쌓기 한 벌", owner: st # ── 정본 파일 ───────────────────────────────────────────────────────── -def test_정본_조합_파일은_빈_채로_있다() -> None: - """줄은 사용자가 화면에서 만듦 — 견본은 시험에서만.""" +def test_정본_조합_파일은_틀대로다() -> None: + """줄 수는 못 박지 않음 — 견본이 있어도 없어도 됨 · 줄은 조합 키(UA)와 열 한 벌만.""" data = store.cm.load([mcb.FILE], folder=REAL)[mcb.FILE] - assert data["그룹"] == mcb.GROUP and data["줄"] == [] + assert data["그룹"] == mcb.GROUP + assert all(row["키"].startswith("UA") and set(row) <= set(mcb.COLS) for row in data["줄"]) assert "원문" not in data # 관리자가 만드는 것이라 원문 근거가 없음