From 94cbf28f166f47f5e539ca6964dae239276a62c2 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sat, 31 Oct 2026 14:19:34 +0900 Subject: [PATCH] =?UTF-8?q?test(298-2):=20B09=20[>]=20=EC=8B=9C=ED=97=98?= =?UTF-8?q?=20=3D=20=EB=B9=88=20=EC=A4=84=200=20=C2=B7=20=EB=B9=88=20?= =?UTF-8?q?=EC=A4=84=20n(409)=20=EB=91=90=20=EA=B0=88=EB=9E=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 까닭: 701-3 「빈 줄 있으면 409」 뒤 시험의 root = Path(".") 가 실제 저장소 뿌리로 내역을 셈 → 빈 줄 생겨 409 로 실패 - payload 를 갈아 끼워 빈 줄 0 = 단계 6 next · 빈 줄 3 = 409 + mark_stage 안 부름 Co-Authored-By: Claude Opus 5.5 --- resources/tester/test_298_2_stage_state.py | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/resources/tester/test_298_2_stage_state.py b/resources/tester/test_298_2_stage_state.py index 309acd0e3..283721225 100644 --- a/resources/tester/test_298_2_stage_state.py +++ b/resources/tester/test_298_2_stage_state.py @@ -226,12 +226,42 @@ def test_b08_b09_next(monkeypatch, module, name, stage_no): async def mark(project_id, no, action, cursor=None): calls.append((no, action)) + async def sheets(_pid, _root): + return {"sheets": {"bill": {"totals": {"direct": {"blank": 0}}}}} + monkeypatch.setattr(mod, "_project_root", root) monkeypatch.setattr(mod, "mark_stage", mark) + if hasattr(mod, "payload"): # B09 = 빈 줄 0 일 때만 확정(701-3) + monkeypatch.setattr(mod, "payload", sheets) assert asyncio.run(getattr(mod, name)(uuid4()))["status"] == "success" assert calls == [(stage_no, "next")] +def test_b09_next_blank_409(monkeypatch): + from fastapi import HTTPException + + from B09_Estimation import B09_Estimation_Router as mod + + calls = [] + + async def root(_pid): + return Path(".") + + async def mark(*a, **k): + calls.append(a) + + async def sheets(_pid, _root): + return {"sheets": {"bill": {"totals": {"direct": {"blank": 3}}}}} + + monkeypatch.setattr(mod, "_project_root", root) + monkeypatch.setattr(mod, "mark_stage", mark) + monkeypatch.setattr(mod, "payload", sheets) + with pytest.raises(HTTPException) as e: + asyncio.run(mod.estimation_complete(uuid4())) + assert e.value.status_code == 409 and "빈 줄 3" in e.value.detail + assert calls == [] + + def test_b08_hydro_save(monkeypatch): from B08_Quantity import B08_Quantity_Router_Hydro as hydro