feat(M01): POST /api/m01/logic/flow — 저장 안 한 고친 줄(옛 편집기)을 흐름으로 변환해 돌려줌(쓰기 없음)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmELpdXFDRZHhfbGuRhSmL
This commit is contained in:
2026-10-02 07:42:47 +09:00
co-authored by Claude Opus 5.5
parent d202a3a6d8
commit c7cd7d4ea0
3 changed files with 33 additions and 4 deletions
@@ -235,6 +235,20 @@ def test_시스템_관리자가_아니면_403(folder: Path) -> None:
client = TestClient(app)
before = _hashes(folder)
assert client.get("/api/m01/logic/flow", params={"key": KEY}).status_code == 403
assert client.post("/api/m01/logic/flow", json={"key": KEY, "row": {}}).status_code == 403
assert client.post("/api/m01/save", json={"files": []}).status_code == 403
assert client.post("/api/m01/calc", json={"key": KEY, "inputs": {}}).status_code == 403
assert _hashes(folder) == before
def test_저장_안_한_고친_줄_변환(client: TestClient, folder: Path) -> None:
"""POST /logic/flow — 옛 편집기 고친 줄 그대로 변환 · 파일은 안 바뀜 · 줄에 흐름이 있어도 변환."""
before = _hashes(folder)
row = copy.deepcopy(_get(client, "/api/m01/logic", key=OLD)["logic"])
row["이름"] = "고친 이름"
row["흐름"] = _flow()
got = _post(client, "/api/m01/logic/flow", {"key": OLD, "row": row})
assert got["converted"] is True and got["flow"]["key"] == OLD
if importlib.util.find_spec(sflow.CONVERT) is not None:
assert got["flow"]["name"] == "고친 이름" and got["flow"]["boxes"]
assert _hashes(folder) == before