fix(B04 배수유역): 369 낡은 분석에 [자동 제안] = 409 낡음 까닭(말없이 그대로 돌려주던 것)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
This commit is contained in:
@@ -494,7 +494,7 @@ async def _resolve(
|
||||
saved = requested is None and stored is not None
|
||||
|
||||
if analysis_route_signature(context.stored_path) != signature:
|
||||
if points is None:
|
||||
if points is None or auto is not None: # 자동 자리 = 지금 노선 분석이 있어야(369)
|
||||
return JSONResponse(
|
||||
status_code=409, content={"status": "stale", "message": STALE_MESSAGE}
|
||||
)
|
||||
|
||||
@@ -115,3 +115,19 @@ def test_틀린_auto_는_400_열쇠에_auto(tmp_path, monkeypatch):
|
||||
points = [PipePoint(chainage_m=20.0)]
|
||||
keys = {basins._detail_key(CONTEXT, points, auto) for auto in basins.AUTO_MODES}
|
||||
assert len(keys) == 3
|
||||
|
||||
|
||||
def test_낡은_분석에_auto_는_409(monkeypatch):
|
||||
async def load(project_id):
|
||||
return CONTEXT, ""
|
||||
|
||||
monkeypatch.setattr(basins, "load_drainage_context", load)
|
||||
monkeypatch.setattr(basins, "analysis_route_signature", lambda stored: "옛 노선")
|
||||
points = [{"chainage_m": 20.0}]
|
||||
for auto in ("all", "add"):
|
||||
result = asyncio.run(
|
||||
basins._resolve(uuid4(), {"points": points, "auto": auto}, use_stored=False)
|
||||
)
|
||||
assert result.status_code == 409 # 말없이 그대로 돌려주지 않음 — 낡음 까닭
|
||||
kept = asyncio.run(basins._resolve(uuid4(), {"points": points}, use_stored=False))
|
||||
assert kept[-1] is True # auto 없음 = 관 자리만 낡음으로(그대로)
|
||||
|
||||
Reference in New Issue
Block a user