test_the_refresh_loop_tells_the_hub_what_it_refreshed

Tests › tests/test_wiki_hub.py

passed Passed in the packaged run.

What this test is for

Why it exists

P4c-2a: keep_current hands the refreshed slugs to the hub.

Verifies REQ-DDB-WIKI-032 REQ-DDB-WIKI-033 REQ-DDB-WIKI-054

Given

  1. told: list[list[str]] = []
  2. class _Hub: def refreshed(self, slugs: list[str]) -> None: told.append(slugs)
8 more
  1. server = DocsDbServer.__new__(DocsDbServer)
  2. server.wiki_hub = _Hub()
  3. async def refresh() -> list[str]: return ["a-123456"]
  4. monkeypatch.setattr(server, "refresh_touched", refresh, raising=False)
  5. server._watcher = type("W", (), {"sync": lambda self, paths: None, "stop": lambda self: None})()
  6. server._touched = {}
  7. async def run() -> None: with anyio.move_on_after(0.5): await server.keep_current(0.05)
  8. anyio.run(run)
→

When

  1. —
→

Then

  1. ✓ told holds
  2. ✓ told[0] equals ["a-123456"]

tests/test_wiki_hub.py:341 · its file's page

What it checks (1)

  1. assert told and told[0] == ["a-123456"] 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 (3)

requirementlinked byimplementers exercised
REQ-DDB-WIKI-032catalogunknown
REQ-DDB-WIKI-033catalogunknown
REQ-DDB-WIKI-054catalogunknown
Also reaches 1 requirement

Its run touches their code; that is reach, not proof.