test_the_policy_is_quiet_then_periodic_then_loud

Tests › tests/test_hook.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE SHAPE THE OWNER SPECIFIED. A session that never reaches for the index in spite of it being installed is the case worth interrupting, and it should be interrupted MORE as it goes on. A session already using it must hear nothing at all.

Verifies REQ-DDB-WIKI-054

Given

  1. —
→

When

  1. hook._is_due(p)
  2. periodic = [p for p in range(hook._QUIET_BELOW, hook._LOUD_AT) if hook._is_due(p)]
  3. list(range(hook._QUIET_BELOW, hook._LOUD_AT, hook._INTERVAL))
  4. loud = [p for p in range(hook._LOUD_AT, hook._LOUD_AT + 12) if hook._is_due(p)]
→

Then

  1. ✓ any(hook._is_due(p) for p in range(hook._QUIET_BELOW)) is false
  2. ✓ periodic equals list(range(hook._QUIET_BELOW, hook._LOUD_AT, hook._INTERVAL))
  3. ✓ loud equals [ p for p in range(hook._LOUD_AT, hook._LOUD_AT + 12) if p % hook._LOUD_INTERVAL == 0 ]
  4. ✓ loud holds
  5. ✓ len(loud) is less than 12

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

What it checks (5)

  1. assert not any(hook._is_due(p) for p in range(hook._QUIET_BELOW)), ( "the hook must say nothing about a handful of ordinary searches" ) observes _is_due
  2. assert periodic == list(range(hook._QUIET_BELOW, hook._LOUD_AT, hook._INTERVAL)), ( f"expected one note every {hook._INTERVAL}; got notes at {periodic}" ) observes list
  3. assert loud == [ p for p in range(hook._LOUD_AT, hook._LOUD_AT + 12) if p % hook._LOUD_INTERVAL == 0 ], f"expected one loud note every {hook._LOUD_INTERVAL}; got notes at {loud}" observes _is_due via loud
  4. assert loud, "the loud tier never fires — the escalation is gone, not merely paced" observes _is_due via loud
  5. assert len(loud) < 12, "the loud tier still fires on every call; the cadence did not apply" observes _is_due via loud

Where the product reaches it

  • main → _is_due (flow)
  • dossier → subject_payload → _flatten_subject → list (flow)

Call flow

test_the_policy_is_quiet_then_periodic_then_loud→_is_due→list

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