feat(FN-004): merge fusion/fn-004

This commit is contained in:
Fusion
2026-05-14 06:47:30 +02:00
parent 4cbd30ff42
commit 3a18a1f170
62 changed files with 2567 additions and 11 deletions
@@ -0,0 +1,35 @@
import pytest
from httpx import AsyncClient
@pytest.mark.asyncio
async def test_project_crud(auth_client: AsyncClient) -> None:
# Create
resp = await auth_client.post("/api/v1/projects", json={"name": "Test", "slug": "test"})
assert resp.status_code == 201
data = resp.json()
assert data["name"] == "Test"
project_id = data["id"]
# List
resp = await auth_client.get("/api/v1/projects")
assert resp.status_code == 200
assert len(resp.json()) == 1
# Get
resp = await auth_client.get(f"/api/v1/projects/{project_id}")
assert resp.status_code == 200
assert resp.json()["slug"] == "test"
# Update
resp = await auth_client.put(f"/api/v1/projects/{project_id}", json={"name": "Updated"})
assert resp.status_code == 200
assert resp.json()["name"] == "Updated"
# Delete
resp = await auth_client.delete(f"/api/v1/projects/{project_id}")
assert resp.status_code == 204
# Verify deletion
resp = await auth_client.get(f"/api/v1/projects/{project_id}")
assert resp.status_code == 404