hex-test-restapi-authlisted
Install: claude install-skill wntic/pyhouse
# Hex Test — REST API Auth
Consult `test-principles` for the testing constitution. Where this skill contradicts `test-principles`,
the constitution wins.
Every test the auth machinery needs — the verifier's own unit test and the auth half of the integration
suite — and all of it exists **only for an app that declares auth**
(`hex-restapi-auth`). An auth-less app produces none of these files: no verifier to test, no
`tests/helpers/jwt.py`, no `tests/integration/api/conftest.py` — this skill creates it — no
`test_unauthenticated_returns_401.py`, and every endpoint test drives a plain ASGI client.
## When to use vs. neighbours
- Any other capability adapter's test — containerized, HTTP-gateway over a stub transport, or another pure-CPU one → `hex-test-capability-adapter`, which owns the three flavors; the verifier test in `UNIT.md` is its pure-CPU flavor bound to auth.
- The containers, the engine, the rollback `session_factory`, `container` and `real_app` itself →
`hex-test-integration-setup` (one-shot; both are defined there and every integration file here consumes
`real_app`).
- A per-endpoint test's non-auth half — success body, advertised error codes, per-resource fixtures →
`hex-test-restapi-endpoint`.
- The other discovered invariants — OpenAPI error codes, CORS, request-size limit, the construct smoke →
`hex-test-app-invariants`.
- The route-side dependencies, the verifier and the code sets under test → `hex-restapi-auth`.
- A handler-level authorization rule