7.77.0 — corbeille réparée (FK favorites/recents) + MCP workspaces
- detach_page_references : nettoyage des références NO ACTION avant toute suppression définitive (unitaire, Empty Trash, purge 30 j) - MCP : list_workspaces / get_workspace ; descriptions collections clarifiées (bases de données, pas des workspaces) - 96 tests verts sur le périmètre (MCP, trash, cohérence)
This commit is contained in:
@@ -68,11 +68,35 @@ def test_mcp_handshake_et_outils(client, jeton):
|
||||
assert r.json()["result"]["serverInfo"]["name"] == "flowdeck"
|
||||
r = _rpc(client, jeton, 2, "tools/list")
|
||||
noms = [t["name"] for t in r.json()["result"]["tools"]]
|
||||
assert noms == ["list_collections", "get_collection", "get_page",
|
||||
assert noms == ["list_workspaces", "get_workspace",
|
||||
"list_collections", "get_collection", "get_page",
|
||||
"search_pages", "list_repos", "create_page",
|
||||
"update_page", "create_collection"]
|
||||
|
||||
|
||||
def test_mcp_workspaces(client, jeton):
|
||||
with get_conn() as conn:
|
||||
conn.execute("INSERT OR IGNORE INTO users (id, login) VALUES (1, 'tester')")
|
||||
cur = conn.execute(
|
||||
"INSERT INTO workspaces (name, owner_id) VALUES ('Techno', 1)")
|
||||
wid = cur.lastrowid
|
||||
conn.execute(
|
||||
"INSERT INTO pages (workspace, workspace_id, title, parent_section) "
|
||||
"VALUES ('Techno', ?, 'Page racine', 'Private')", (wid,))
|
||||
conn.execute(
|
||||
"INSERT INTO pages (workspace, workspace_id, title, parent_section, deleted_at) "
|
||||
"VALUES ('Techno', ?, 'Page corbeille', 'Private', '2026-10-11 10:00:00')", (wid,))
|
||||
conn.commit()
|
||||
ws = _appel(client, jeton, 70, "list_workspaces")
|
||||
techno = [w for w in ws if w["name"] == "Techno"]
|
||||
assert techno and techno[0]["page_count"] == 1 # la corbeille ne compte pas
|
||||
detail = _appel(client, jeton, 71, "get_workspace", {"id": wid})
|
||||
assert detail["workspace"]["name"] == "Techno"
|
||||
assert [p["title"] for p in detail["pages"]] == ["Page racine"]
|
||||
res = _appel(client, jeton, 72, "get_workspace", {"id": 99999})
|
||||
assert "introuvable" in res["erreur"]
|
||||
|
||||
|
||||
def test_mcp_collections_et_pages(client, jeton, donnees):
|
||||
cols = _appel(client, jeton, 1, "list_collections")
|
||||
alpha = [c for c in cols if c["name"] == "Projet Alpha"]
|
||||
|
||||
Reference in New Issue
Block a user