Quick Start
How It Works
| Layer | Purpose |
|---|---|
| pytest-asyncio | Async test runner |
| ASGITransport | In-memory requests against the real app |
| PlatformClient | HTTP wrapper with auto-authentication |
| SQLite memory | Isolated database per test run |
Test Coverage
| Area | Endpoints | Verification |
|---|---|---|
| Authentication | /auth/register, /auth/login, /auth/me | JWT returned, user retrieved |
| Workspaces | CRUD on /workspaces/ | Owner membership enforced |
| Projects | CRUD on /workspaces/{id}/projects/ | Scoped to workspace |
| Issues | CRUD on /workspaces/{id}/issues/ | Issue numbers assigned |
| RBAC | All workspace-scoped routes | Non-members receive 403 |
RBAC enforcement test
Best Practices
Use in-memory database for speed
Use in-memory database for speed
Configure SQLite with
:memory: in test fixtures for fast, isolated runs.Test against the real FastAPI app
Test against the real FastAPI app
Use
ASGITransport(app=create_app()) so tests exercise actual route logic and dependencies.Verify RBAC on every workspace route
Verify RBAC on every workspace route
Assert 403 for non-members on projects, issues, agents, labels, and dependencies.
Isolate test data with unique emails
Isolate test data with unique emails
Use
f"test-{uuid.uuid4()}@example.com" per test to avoid collisions.Related
Platform SDK Client
Complete PlatformClient API reference
RBAC Enforcement
Workspace membership and role checks

