test_wiki_objects_inv.py¶
tests/test_wiki_objects_inv.py
The site's objects.inv lists every symbol section, not only pages and labels (P5, S8; 2.0.0).
test_every_symbol_section_is_an_object
None test_wiki_objects_inv.test_every_symbol_section_is_an_object(inventory)
file::name for each section, pointing at its page and anchor.
tests/test_wiki_objects_inv.py:49
Checks
assert "pkg/a.py::run" in functions and "pkg/b.py::other" in functionsassert "pkg/a.py::helper" in functions and "pkg/b.py::helper" in functionsassert functions["pkg/a.py::run"] == f"{page_for('pkg/a.py')}.html#{anchor('run')}"
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-WIKI-025 | measured | test_every_symbol_section_is_an_object → page_for |
Source · 10 lines
def test_every_symbol_section_is_an_object(inventory) -> None:
"""@brief file::name for each section, pointing at its page and anchor."""
functions = inventory.get("clew:function", {})
assert "pkg/a.py::run" in functions and "pkg/b.py::other" in functions
assert "pkg/a.py::helper" in functions and "pkg/b.py::helper" in functions
from clew.wiki.symbols import anchor, page_for
assert functions["pkg/a.py::run"] == f"{page_for('pkg/a.py')}.html#{anchor('run')}"