← ClaudeAtlas

hex-test-restapi-endpointlisted

Use when testing one REST endpoint through the real ASGI app — one file per endpoint under `tests/integration/api/<resource>/`, asserting the success body and each advertised error code, with per-resource fixtures in a sibling `conftest.py`. Not properties discovered across all routes at once (`hex-test-app-invariants`), not the auth half — a token verifier's unit test, 401/403, role rejection, cross-tenant 404 (`hex-test-restapi-auth`) — and not the fixtures themselves (`hex-test-integration-setup`).
wntic/pyhouse · ★ 3 · API & Backend · score 76
Install: claude install-skill wntic/pyhouse
# Hex Test — REST API Endpoint Consult `test-principles` for the testing constitution. Where this skill contradicts `test-principles`, the constitution wins. Produces one integration-test file per endpoint. Self-contained: every test in the file constructs its own state by calling factory fixtures or POSTing through the API; no cross-test state, no shared registries, no cross-file edits when a new endpoint is added. ## When to use vs. neighbours - A new or modified endpoint added by `hex-restapi-endpoint` → this skill. - A new resource introduces several endpoints (create + list + get + update + delete) → invoke this skill once per endpoint file; sibling files share a per-resource `conftest.py`. - The `tests/integration/conftest.py` itself (rollback, container fixtures, `container`, `real_app`) → `hex-test-integration-setup` (one-shot). - The auth half — the `authenticated_client` factory and its signing-key fixtures, a route driven as an authenticated caller, a role rejection or a cross-tenant 404, the token verifier's own unit test → `hex-test-restapi-auth` (auth apps only; this skill is complete without it). - The route-side auth dependency, the role gate and the 401/403 codes a route advertises because of them → `hex-restapi-auth`. - Cross-cutting "every advertised error code carries the catalogue's shape" / CORS / request-size → `hex-test-app-invariants` (one-shot; discovers by walking the app's published document). - Repository contract (real DB, no HTTP) → `hex-tes