test_the_policy_is_quiet_then_periodic_then_loud¶
Tests › tests/test_hook.py
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
- —
When
hook._is_due(p)periodic = [p for p in range(hook._QUIET_BELOW, hook._LOUD_AT) if hook._is_due(p)]list(range(hook._QUIET_BELOW, hook._LOUD_AT, hook._INTERVAL))loud = [p for p in range(hook._LOUD_AT, hook._LOUD_AT + 12) if hook._is_due(p)]
Then
- ✓ any(hook._is_due(p) for p in range(hook._QUIET_BELOW)) is false
- ✓ periodic equals list(range(hook._QUIET_BELOW, hook._LOUD_AT, hook._INTERVAL))
- ✓ loud equals [ p for p in range(hook._LOUD_AT, hook._LOUD_AT + 12) if p % hook._LOUD_INTERVAL == 0 ]
- ✓ loud holds
- ✓ len(loud) is less than 12
tests/test_hook.py:415 · its file's page
What it checks (5)
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_dueassert periodic == list(range(hook._QUIET_BELOW, hook._LOUD_AT, hook._INTERVAL)), ( f"expected one note every {hook._INTERVAL}; got notes at {periodic}" )observeslistassert 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_duevialoudassert loud, "the loud tier never fires — the escalation is gone, not merely paced"observes_is_duevialoudassert len(loud) < 12, "the loud tier still fires on every call; the cadence did not apply"observes_is_duevialoud
Where the product reaches it
Call flow
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)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-WIKI-054 | catalog | unknown |