Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions backend/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,14 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
)

# --- Routes ---
from app.api.routes import generate, health # noqa: E402
from app.api.routes import export, generate, health, styles # noqa: E402

app.include_router(generate.router, prefix="/api", tags=["generation"])
app.include_router(health.router, tags=["health"])

# Optional: register export and styles routes when ready
# from app.api.routes import export, styles
# app.include_router(export.router, prefix="/api", tags=["export"])
# app.include_router(styles.router, prefix="/api", tags=["styles"])
app.include_router(export.router, prefix="/api", tags=["export"])
app.include_router(styles.router, prefix="/api", tags=["styles"])


@app.get("/")
Expand Down
13 changes: 11 additions & 2 deletions backend/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,14 @@ class TestExportEndpoint:

def test_export_requires_job_id(self) -> None:
"""Should return 422 if job_id is missing."""
# TODO: Implement
pass
response = client.post("/api/export", json={"format": "png"})
assert response.status_code == 422

data = response.json()
assert "detail" in data

# Check that job_id is the missing field
missing_fields = [
error["loc"][-1] for error in data["detail"] if error["type"] == "missing"
]
assert "job_id" in missing_fields
Loading