test_an_unparsed_file_is_registered_as_known_but_unread¶
Tests › tests/test_unparsed_file_registration.py
What this test is for
Why it exists
RED BEFORE THE FIX: `claims()` returns False for `.pl`, so `register_paths` inserts no row and the file is not in the file set at all.
Given
db = tmp_path / "clew.db"conn = sqlite3.connect(str(db))
3 more
conn.execute( "CREATE TABLE path (rowid INTEGER PRIMARY KEY, type INTEGER, local INTEGER, " "found INTEGER, name TEXT)" )conn.commit()conn.close()
When
inserted = register_paths(db, ["scripts/generate_errors.pl", "src/app.ts"])conn = sqlite3.connect(str(db))rows = dict(conn.execute("SELECT name, found FROM path"))conn.close()
Then
- ✓ inserted equals 2
- ✓ rows["scripts/generate_errors.pl"] equals 0
- ✓ rows["src/app.ts"] equals 1
tests/test_unparsed_file_registration.py:92 · its file's page
What it checks (3)
assert inserted == 2, "both the unparsed file and the claimed TS file must be registered"observesregister_pathsviainsertedassert rows["scripts/generate_errors.pl"] == 0, ( "a file no grammar reads must report that it was NOT resolved to content; found=1 would " "claim it was parsed" )not attributedassert rows["src/app.ts"] == 1, ( "C5 must not change what a file the parse front end DOES read reports" )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 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-PIPE-012 measured