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

Show on the map →

Called by none

Calls anchor, page_for

Checks

  • 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
  • assert functions["pkg/a.py::run"] == f"{page_for('pkg/a.py')}.html#{anchor('run')}"

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-WIKI-025measuredtest_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')}"

Activity · 5 steps
lines 51–51functions = inventory.get("clew:function", {})lines 52–52assert "pkg/a.py::run" in functions and "pkg/b.py::other" in functionslines 53–53assert "pkg/a.py::helper" in functions and "pkg/b.py::helper" in functionslines 54–54from clew.wiki.symbols import anchor, page_forlines 56–56assert functions["pkg/a.py::run"] == f"{page_for('pkg/a.py')}.html#{anchor('run')}"