test_rows_are_located_on_the_lookups_own_file_key

Tests › tests/test_pydocs.py

passed Passed in the packaged run.

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

  1. conn = sqlite3.connect(":memory:")
  2. conn.execute("CREATE TABLE memberdef (name TEXT, file_id INT, bodyfile_id INT, line INT)")
5 more
  1. conn.execute("CREATE TABLE compounddef (name TEXT, file_id INT, line INT)")
  2. conn.execute("INSERT INTO memberdef VALUES ('decl_only', 1, 0, 3)")
  3. conn.execute("INSERT INTO memberdef VALUES ('decl_only_null', 1, NULL, 4)")
  4. conn.execute("INSERT INTO memberdef VALUES ('defined', 1, 2, 5)")
  5. conn.execute("INSERT INTO compounddef VALUES ('mod::C', 2, 7)")
→

When

  1. located = _locate_rows(conn)
→

Then

  1. ✓ 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)

  1. assert located == { ("memberdef", 1, 3): [1], ("memberdef", 1, 4): [2], ("memberdef", 2, 5): [3], ("compounddef", 2, 7): [1], } observes _locate_rows via located

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_rows

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-PIPE-013catalogunknown