test(298-2): B09 [>] 시험 = 빈 줄 0 · 빈 줄 n(409) 두 갈래

- 까닭: 701-3 「빈 줄 있으면 409」 뒤 시험의 root = Path(".") 가 실제 저장소 뿌리로 내역을 셈 → 빈 줄 생겨 409 로 실패
- payload 를 갈아 끼워 빈 줄 0 = 단계 6 next · 빈 줄 3 = 409 + mark_stage 안 부름

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 14:19:34 +09:00
co-authored by Claude Opus 5.5
parent a6b54f04e5
commit 94cbf28f16
@@ -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