test_source_bodies_and_diagrams_are_not_in_the_search_index¶
Tests › tests/test_wiki_site.py
What this test is for
Why it exists
P5.1b (2.0.0, page weight). MEASURED on clew's own site: searchindex.js was 8.2 MB, 6.35 MB of it 80,285 terms, because Sphinx's indexer strips the tags off RAW HTML and indexes the text — every folded source body, activity statement and SVG label. A function is found by its heading, signature and brief; code text is what the index's own code search is for. `SECRET_BODY_MARKER` lives only in `parse`'s body; `parse` itself must stay findable.
Verifies REQ-DDB-WIKI-011 REQ-DDB-WIKI-012 REQ-DDB-WIKI-013 REQ-DDB-WIKI-014 REQ-DDB-WIKI-015 REQ-DDB-WIKI-018 REQ-DDB-WIKI-020 REQ-DDB-WIKI-021 REQ-DDB-WIKI-022 REQ-DDB-WIKI-023 REQ-DDB-WIKI-025 REQ-DDB-WIKI-031 REQ-DDB-WIKI-044 REQ-DDB-WIKI-050 REQ-DDB-WIKI-052
Given
index = (pathlib.Path(site["__html__"]) / "searchindex.js").read_text()
When
- —
Then
- ✓ index.lower() does not contain "secret_body_mark"
- ✓ index.lower() does not contain "secret_body_marker"
- ✓ index contains '"pars'
tests/test_wiki_site.py:1065 · its file's page
What it checks (2)
assert "secret_body_mark" not in index.lower() and "secret_body_marker" not in index.lower()not attributedassert '"pars' in index, "the function's own name must stay searchable"not attributed
What it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Requirements it verifies (15)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-WIKI-011 | catalog | unknown |
| REQ-DDB-WIKI-012 | catalog | unknown |
| REQ-DDB-WIKI-013 | catalog | unknown |
| REQ-DDB-WIKI-014 | catalog | unknown |
| REQ-DDB-WIKI-015 | catalog | unknown |
| REQ-DDB-WIKI-018 | catalog | unknown |
| REQ-DDB-WIKI-020 | catalog | unknown |
| REQ-DDB-WIKI-021 | catalog | unknown |
| REQ-DDB-WIKI-022 | catalog | unknown |
| REQ-DDB-WIKI-023 | catalog | unknown |
| REQ-DDB-WIKI-025 | catalog | unknown |
| REQ-DDB-WIKI-031 | catalog | unknown |
| REQ-DDB-WIKI-044 | catalog | unknown |
| REQ-DDB-WIKI-050 | catalog | unknown |
| REQ-DDB-WIKI-052 | catalog | unknown |