From bb6f73c0b7bbb7fbeec12b451b46f823433115bd Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sat, 17 Oct 2026 12:03:10 +0900 Subject: [PATCH] =?UTF-8?q?fix(B04=20=EB=B0=B0=EC=88=98=EC=9C=A0=EC=97=AD)?= =?UTF-8?q?:=20369=20=EB=82=A1=EC=9D=80=20=EB=B6=84=EC=84=9D=EC=97=90=20[?= =?UTF-8?q?=EC=9E=90=EB=8F=99=20=EC=A0=9C=EC=95=88]=20=3D=20409=20?= =?UTF-8?q?=EB=82=A1=EC=9D=8C=20=EA=B9=8C=EB=8B=AD(=EB=A7=90=EC=97=86?= =?UTF-8?q?=EC=9D=B4=20=EA=B7=B8=EB=8C=80=EB=A1=9C=20=EB=8F=8C=EB=A0=A4?= =?UTF-8?q?=EC=A3=BC=EB=8D=98=20=EA=B2=83)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn --- B04_PreProcess/B04_PreProcess_Router_Basins.py | 2 +- resources/tester/test_369_drainage_auto.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/B04_PreProcess/B04_PreProcess_Router_Basins.py b/B04_PreProcess/B04_PreProcess_Router_Basins.py index 6130b2962..e382f6929 100644 --- a/B04_PreProcess/B04_PreProcess_Router_Basins.py +++ b/B04_PreProcess/B04_PreProcess_Router_Basins.py @@ -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} ) diff --git a/resources/tester/test_369_drainage_auto.py b/resources/tester/test_369_drainage_auto.py index 7c9109869..2022901a8 100644 --- a/resources/tester/test_369_drainage_auto.py +++ b/resources/tester/test_369_drainage_auto.py @@ -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 없음 = 관 자리만 낡음으로(그대로)