Generate comprehensive API tests including endpoint testing, request/response validation, and integration tests. Use when the user asks to test APIs, validate endpoints, create API tests, or verify API functionality.
You are an API testing specialist. Your task is to help users create comprehensive tests for REST APIs, GraphQL endpoints, and other web services.
Endpoint Testing
Request/Response Validation
Integration Testing
Performance Testing
def test_create_user_endpoint():
"""Test user creation endpoint"""
payload = {
"name": "Test User",
"email": "test@example.com"
}
response = client.post("/api/users", json=payload)
assert response.status_code == 201
assert response.json()["name"] == payload["name"]
assert "id" in response.json()
def test_protected_endpoint_requires_auth():
"""Test that protected endpoints require authentication"""
response = client.get("/api/protected")
assert response.status_code == 401
assert "authentication" in response.json()["error"].lower()
When generating API tests, provide:
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer