> ## Documentation Index
> Fetch the complete documentation index at: https://calendar-effects.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# tests/test_docs_site.py

> The documentation site (docs-site/, decision 0011) must cover every file and be up to date.

`tests/test_docs_site.py` · chapter [Tests and team tooling](https://calendar-effects.mintlify.site/tour/10-tests-and-tooling.md), file 13 · 40 lines · [open in the repository](https://github.sfu.ca/aba395/Calendar-Effects/blob/main/tests/test_docs_site.py)

## What it does

The documentation site (docs-site/, decision 0011) must cover every file and be up to date.

If a test here fails: for a new file, add it to a chapter in docs-site/reading\_order.json;
then run python3 scripts/build\_docs.py and stage docs-site/ with your change.

## What is inside

* **`ROOT`** · [line 9](https://github.sfu.ca/aba395/Calendar-Effects/blob/main/tests/test_docs_site.py#L9)

## What it checks

* every file has a place in the tour (line 15)
* the site is up to date (line 20)
* text is escaped for mdx but code is left alone (line 25)
* commands indented in a docstring become a code block (line 31)
* every file gets a stable page name (line 36)

## Source

````python title="tests/test_docs_site.py" lines expandable theme={null}
"""The documentation site (docs-site/, decision 0011) must cover every file and be up to date.

If a test here fails: for a new file, add it to a chapter in docs-site/reading_order.json;
then run python3 scripts/build_docs.py and stage docs-site/ with your change.
"""
import importlib.util
from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]
_spec = importlib.util.spec_from_file_location("build_docs", ROOT / "scripts" / "build_docs.py")
build_docs = importlib.util.module_from_spec(_spec)
_spec.loader.exec_module(build_docs)


def test_every_file_has_a_place_in_the_tour():
    problems = build_docs.coverage_problems(build_docs.load_order(), build_docs.tracked_files())
    assert not problems, "\n".join(problems)


def test_the_site_is_up_to_date():
    behind = build_docs.stale(build_docs.build())
    assert not behind, "Run python3 scripts/build_docs.py and stage docs-site/. Out of date:\n" + "\n".join(behind)


def test_text_is_escaped_for_mdx_but_code_is_left_alone():
    assert build_docs.mdx("a {b} <c> `{d} <e>`") == "a \\{b\\} &lt;c> `{d} <e>`"
    fenced = "```python\nx = {1: '<a>'}\n```"
    assert build_docs.mdx(fenced) == fenced


def test_commands_indented_in_a_docstring_become_a_code_block():
    out = build_docs.docstring_markdown("Run it:\n    python3 x.py --once\nThen look.")
    assert "```bash\npython3 x.py --once\n```" in out


def test_every_file_gets_a_stable_page_name():
    assert build_docs.page_of("src/common/study.py") == "reference/src/common/study"
    assert build_docs.page_of("src/common/__init__.py") == "reference/src/common/init"
    assert build_docs.page_of(".claude/hooks/session-brief.sh") == "reference/claude/hooks/session-brief-sh"
    assert build_docs.page_of("config/retailers.csv") == "reference/config/retailers-csv"
````


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.