test_rows_are_located_on_the_lookups_own_file_key¶
Tests › tests/test_pydocs.py
What this test is for
Why it exists
A member is keyed by its body file, else its declaring file; a class by its file.
Verifies REQ-DDB-PIPE-013
Given
conn = sqlite3.connect(":memory:")conn.execute("CREATE TABLE memberdef (name TEXT, file_id INT, bodyfile_id INT, line INT)")
5 more
conn.execute("CREATE TABLE compounddef (name TEXT, file_id INT, line INT)")conn.execute("INSERT INTO memberdef VALUES ('decl_only', 1, 0, 3)")conn.execute("INSERT INTO memberdef VALUES ('decl_only_null', 1, NULL, 4)")conn.execute("INSERT INTO memberdef VALUES ('defined', 1, 2, 5)")conn.execute("INSERT INTO compounddef VALUES ('mod::C', 2, 7)")
When
located = _locate_rows(conn)
Then
- ✓ located equals { ("memberdef", 1, 3): [1], ("memberdef", 1, 4): [2], ("memberdef", 2, 5): [3], ("compounddef", 2, 7): [1], }
tests/test_pydocs.py:132 · its file's page
What it checks (1)
assert located == { ("memberdef", 1, 3): [1], ("memberdef", 1, 4): [2], ("memberdef", 2, 5): [3], ("compounddef", 2, 7): [1], }observes_locate_rowsvialocated
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
test_rows_are_located_on_the_lookups_own_file_key→_locate_rowsWhat 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-PIPE-013 | catalog | unknown |