← ClaudeAtlas

hex-test-app-invariantslisted

Use when testing a property of the assembled HTTP app itself rather than one route's own behaviour — a check that needs no edit when an endpoint is added or removed — or the construct smoke any entrypoint gets. Covers the catalogue's error shape on every error code the published OpenAPI document advertises, the CORS preflight and the request-size limit where the app configures them, and the app-construction smoke, each built with `create_app()` and taking its inputs from the app rather than from a maintained list; a service with no HTTP entrypoint keeps only the smoke, for its own entrypoint. A single endpoint's test is `hex-test-restapi-endpoint`; the anonymous-caller probe and every token fixture are `hex-test-restapi-auth`'s.
wntic/pyhouse · ★ 3 · Code & Development · score 76
Install: claude install-skill wntic/pyhouse
# Hex Test — App Invariants Consult `test-principles` for the testing constitution. Where this skill contradicts `test-principles`, the constitution wins. One-shot per project. An HTTP app gets up to four files under `tests/unit/restapi/`, each of which builds the app with `create_app()` and asserts a single global property; a service with no HTTP entrypoint gets only the construct smoke, for its own entrypoint (rule 10). None of them needs to be edited when an endpoint is added or removed. None needs a store, so none waits on the integration suite's containers. An app that declares auth gains one more discovered invariant — every protected route rejects an anonymous caller — which is `hex-test-restapi-auth`'s. ## When to use vs. neighbours - Laying the cross-cutting tests for the first time → this skill. - A per-endpoint integration test → `hex-test-restapi-endpoint`. - The integration fixtures, `real_app` among them → `hex-test-integration-setup`; nothing here takes them. - The every-protected-route-rejects-an-anonymous-caller probe, and the fixtures that mint tokens → `hex-test-restapi-auth` (auth apps only; nothing here consumes them — see Rule 8). - The route-side `error_responses(...)` declaration that puts the catalogue's shape on each advertised code → `hex-restapi-endpoint`, in its sibling `CONTRACTS.md`; the 401/403 half of it → `hex-restapi-auth`. - A grep-firewall static rule → `test-architecture-rule` (compile-time, not runtime). - The testing constitution —