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