test_the_sanitiser_codomain_is_total

Tests › tests/test_hook.py

passed Passed in the packaged run.

What this test is for

Why it exists

The sanitiser's output set is proved over the whole input alphabet, not sampled.

Verifies REQ-DDB-WIKI-054

tests/test_hook.py:836 · its file's page

What it checks (5)

  1. assert set(result) <= hook._NAME_SAFE, (f"_safe_token({probe!r}) returned {result!r}, which contains characters outside the " f"documented codomain: {sorted(set(result) - hook._NAME_SAFE)!r}" )
  2. assert 1 <= len(result) <= hook._NAME_MAX, f"length out of bounds: {result!r}"
  3. assert not result.startswith("."), f"a dotfile survived: {result!r}"
  4. assert accepted, "nothing was accepted at all — this proof would be vacuous"
  5. assert hook._safe_token(junk) is None, f"{junk!r} was not refused"

Where the product reaches it

  • main → _target_name → _safe_token (flow)

Call flow

test_the_sanitiser_codomain_is_total→_safe_token

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 (1)

requirementlinked byimplementers exercised
REQ-DDB-WIKI-054catalogunknown