test_inferred_invalid_dispatch_mode_fails_closed¶
Tests › tests/test_r1_richness.py
What this test is for
Why it exists
An invalid declared dispatch_mode REFUSES the build with a DeclarationError naming the file, the token and the allowed set.
Verifies REQ-DDB-SCHEMA-001 REQ-DDB-SCHEMA-002 REQ-DDB-SCHEMA-003 REQ-DDB-SCHEMA-004 REQ-DDB-SCHEMA-007
Given
src = tmp_path / "src"src.mkdir()
4 more
(src / "foo.c").write_text( "void producer(void) { QUEUESEND(&q, m); }\n" "void consumer(void) { QUEUERECEIVE(&q, &m); }\n", )db = _make_db(tmp_path, [(1, "producer", 1, 1), (2, "consumer", 2, 2)])patterns = tmp_path / "patterns.yaml"patterns.write_text( "writers:\n" " - pattern: QUEUESEND\n" " key_arg_index: 0\n" " dispatch_mode: sync\n" # INVALID — not in the CHECK set "readers:\n" " - pattern: QUEUERECEIVE\n" " key_arg_index: 0\n", )
When
import_shared_key_edges_inferred(db, tmp_path, patterns)message = str(exc.value)
Then
- ✓ raises DeclarationError
- ✓ message contains "patterns.yaml"
- ✓ message contains "'sync'"
- ✓ message contains "inline, queued, keyed, unknown"
tests/test_r1_richness.py:720 · its file's page
What it checks (3)
assert "patterns.yaml" in messagenot attributedassert "'sync'" in messagenot attributedassert "inline, queued, keyed, unknown" in messagenot attributed
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
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 (5)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-SCHEMA-001 | catalog | unknown |
| REQ-DDB-SCHEMA-002 | catalog | 1 of 2: _writer_dispatch_map |
| REQ-DDB-SCHEMA-003 | catalog | unknown |
| REQ-DDB-SCHEMA-004 | catalog | unknown |
| REQ-DDB-SCHEMA-007 | catalog | 1 of 3: _ensure_shared_key_edges_table |
Also reaches 9 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 inferred
- REQ-DDB-INDEX-002 inferred
- REQ-DDB-PIPE-003 inferred
- REQ-DDB-PIPE-010 inferred
- REQ-DDB-PIPE-011 inferred
- REQ-DDB-PIPE-012 inferred
- REQ-DDB-SCHEMA-005 measured
- REQ-DDB-SCHEMA-012 measured