Quick Start
How It Works
| Component | Purpose | Technology |
|---|---|---|
| Test Suite | Comprehensive integration tests | pytest-asyncio |
| SDK Client | HTTP client for platform API | httpx.AsyncClient |
| ASGI Transport | In-memory testing against real app | ASGITransport |
| Database | Isolated test storage | SQLite (in-memory) |
Test Coverage Matrix
Authentication Tests
| Test Case | Endpoint | Verification |
|---|---|---|
| User registration | POST /auth/register | User created, JWT returned |
| User login | POST /auth/login | Authentication successful |
| Get current user | GET /auth/me | User data retrieved |
Workspace Management
| Test Case | Endpoint | Verification |
|---|---|---|
| Create workspace | POST /workspaces/ | Workspace created with owner |
| List workspaces | GET /workspaces/ | User’s workspaces returned |
| Get workspace | GET /workspaces/{id} | Workspace details retrieved |
| Update workspace | PATCH /workspaces/{id} | Workspace modified |
| Delete workspace | DELETE /workspaces/{id} | Workspace removed |
Project Operations
| Test Case | Endpoint | Verification |
|---|---|---|
| Create project | POST /workspaces/{id}/projects/ | Project created in workspace |
| List projects | GET /workspaces/{id}/projects/ | Workspace projects returned |
| Get project | GET /workspaces/{id}/projects/{id} | Project details retrieved |
| Update project | PATCH /workspaces/{id}/projects/{id} | Project modified |
| Delete project | DELETE /workspaces/{id}/projects/{id} | Project removed |
| Project statistics | GET /workspaces/{id}/projects/{id}/stats | Issue counts returned |
Issue Management
| Test Case | Endpoint | Verification |
|---|---|---|
| Create issue | POST /workspaces/{id}/issues/ | Issue created with number |
| List issues | GET /workspaces/{id}/issues/ | Workspace issues returned |
| Get issue | GET /workspaces/{id}/issues/{id} | Issue details retrieved |
| Update issue | PATCH /workspaces/{id}/issues/{id} | Issue modified |
| Delete issue | DELETE /workspaces/{id}/issues/{id} | Issue removed |
RBAC Enforcement Tests
RBAC Test Implementation
Common Patterns
Test Data Setup
Error Handling Tests
End-to-End Workflows
Best Practices
Use In-Memory Database
Use In-Memory Database
Configure SQLite with in-memory database for fast, isolated tests:
Test Against Real FastAPI App
Test Against Real FastAPI App
Use ASGITransport to test against the actual FastAPI application:
Verify RBAC Comprehensively
Verify RBAC Comprehensively
Test authorization on every workspace-scoped endpoint:
Clean Test Isolation
Clean Test Isolation
Each test should create its own data to avoid conflicts:
Related
Platform API Reference
Complete API endpoint documentation
Authentication & RBAC
Security and access control details

