test_wiki_viewer.py

tests/test_wiki_viewer.py

Viewer caps that expand without bloating the page (V1–V6; owner Q/A 2026-11-20).

test_flows_past_the_cap_open_in_a_details

None test_wiki_viewer.test_flows_past_the_cap_open_in_a_details()

V5: 7 flows on a changed function's row — 5 shown, 2 behind "2 more", all linked.

tests/test_wiki_viewer.py:36

Show on the map →

Called by none

Calls _flow_cell, all

Checks

  • assert "<summary>2 more</summary>" in html
  • assert all(f'href="flow-{i}.html"' in html for i in range(7))

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-WIKI-029measuredtest_flows_past_the_cap_open_in_a_details → _flow_cell
REQ-DDB-WIKI-054inferredtest_flows_past_the_cap_open_in_a_details → all
Source · 10 lines
def test_flows_past_the_cap_open_in_a_details() -> None:
    """@brief V5: 7 flows on a changed function's row — 5 shown, 2 behind "2 more", all linked."""
    from clew.wiki.impactpage import _flow_cell

    pages = [SimpleNamespace(name=f"flow-{i}", title=f"Flow {i}", role="product") for i in range(7)]
    html = _flow_cell(pages)
    assert "<summary>2 more</summary>" in html
    assert all(f'href="flow-{i}.html"' in html for i in range(7))

Activity · 5 steps
lines 38–38from clew.wiki.impactpage import _flow_celllines 40–40pages = [SimpleNamespace(name=f"flow-{i}", title=f"Flow {i}", role="product") for i in range(7)]lines 41–41html = _flow_cell(pages)lines 42–42assert "<summary>2 more</summary>" in htmllines 43–43assert all(f'href="flow-{i}.html"' in html for i in range(7))

test_neighbours_past_the_cap_open_in_a_details

None test_wiki_viewer.test_neighbours_past_the_cap_open_in_a_details()

V3: 15 callers — 12 inline, 3 behind "3 more", every name present.

tests/test_wiki_viewer.py:26

Show on the map →

Called by none

Calls all

Checks

  • assert "<summary>3 more</summary>" in html
  • assert all(f">f{i}<" in html for i in range(15))

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-WIKI-025measured
REQ-DDB-WIKI-054inferredtest_neighbours_past_the_cap_open_in_a_details → all
Source · 10 lines
def test_neighbours_past_the_cap_open_in_a_details() -> None:
    """@brief V3: 15 callers — 12 inline, 3 behind "3 more", every name present."""
    from clew.wiki.symbols import _names

    pairs = [(f"f{i}", "a.py") for i in range(15)]
    html = _names(pairs, {("f0", "a.py")})
    assert "<summary>3 more</summary>" in html
    assert all(f">f{i}<" in html for i in range(15))

Activity · 5 steps
lines 28–28from clew.wiki.symbols import _nameslines 30–30pairs = [(f"f{i}", "a.py") for i in range(15)]lines 31–31html = _names(pairs, {("f0", "a.py")})lines 32–32assert "<summary>3 more</summary>" in htmllines 33–33assert all(f">f{i}<" in html for i in range(15))