test_invalid_declared_role_fails_closed¶
Tests › tests/test_locks.py
What this test is for
Why it exists
`role` was the ONE declared lock enum with no guard at all: it rode raw into the INSERT and tripped `CHECK(role IN (...))` as a bare IntegrityError mid-build, naming neither the pattern nor the file. It now refuses at load time like its three siblings.
Given
- —
When
load_lock_patterns({"locks": [{"name": "W", "role": "lock"}]})
Then
- ✓ raises DeclarationError
- ✓ str(exc.value) contains "'lock'"
- ✓ str(exc.value) contains "acquire, try_acquire, scoped"
tests/test_locks.py:220 · its file's page
What it checks (2)
assert "'lock'" in str(exc.value)not attributedassert "acquire, try_acquire, scoped" in str(exc.value)not 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.
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-SCHEMA-011 measured
- REQ-DDB-SCHEMA-012 measured