Files
DeepTutor/docs/tests
AleFlyX 3e4d2d848d docs: add doc contract tests
A gate on a different axis from the site's existing structural checks: not
whether files agree with each other, but whether the things the pages *name*
still exist in the code.

Four assertions:

- every `deeptutor <group>` and `deeptutor <group> <sub>` in prose is a
  registered command
- every `/api/...` path in prose is a route the backend mounts
- install pins match `deeptutor/__version__.py`
- every page has a frontmatter description

They parse the source tree with `ast` instead of importing DeepTutor, so CI
needs only pytest and no runtime dependencies. They live under `docs/tests/`
rather than the repository-level `tests/` because `tests/conftest.py` has autouse
fixtures that build the application container, which would pull in the full
dependency set.

Three cases needed explicit handling, documented in the module:

- A third-party endpoint (`/api/v4/users/me` on the Mattermost page) is declared
  per page in `FOREIGN_API_PAGES`. Both the current `partners/` path and the
  reorganized `channels/international/` path are listed, so the check stays
  correct across the docs restructure. A blanket prefix rule would have skipped
  the exact mistake these tests exist to catch.
- A sentence describing a retired command (`deeptutor bot` in the TutorBot
  migration note) is skipped via `RETIRED_MARKERS`.
- A group whose registration cannot be read statically returns `None` and is
  skipped, so an unfamiliar registration shape produces no false report.
2026-11-26 21:34:47 +08:00
..
2026-11-26 21:34:47 +08:00
2026-11-26 21:34:47 +08:00