test_the_registered_file_answers_as_a_file_subject¶
Tests › tests/test_unparsed_file_registration.py
What this test is for
Why it exists
THE END THE MARK IS GRADED ON. Registration is the mechanism; being nameable is the outcome. C1 made a path a `dossier` subject, so the two changes together turn `scripts/generate_errors.pl` from a definitive negative into a reply that names the file and states plainly that nothing was harvested from it.
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
register_paths(db, ["scripts/generate_errors.pl"])conn = sqlite3.connect(str(db))try: built = file_subject(conn, "scripts/generate_errors.pl") assert built is not None, "the mark wants this name findable; a miss is the old answer" assert built.symbol_count == 0 assert built.harvested is False, ( "`I know of this file and could not read it` is the claim; `harvested=True` would " "say it was read and declares nothing, which is a different and wrong fact" ) finally: conn.close()list_files(db, "*.pl")
Then
- ✓ {f.path for f in list_files(db, "*.pl")} contains "scripts/generate_errors.pl"
What it exercises
The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.
clew — `main` (clew/cli.py) · 5 of 400 steps
… 215 earlier steps
… 119 steps between
… 53 later steps
3 more
- `main` (scripts/export_parity.py) · 5 of 203 steps
- Build this wiki from the index · 1 of 400 steps
- Look up one name: everything the index holds about it · 1 of 226 steps
tests/test_unparsed_file_registration.py:128 · its file's page
What it checks (4)
assert built is not None, "the mark wants this name findable; a miss is the old answer"observesfile_subjectviabuiltassert built.symbol_count == 0observesfile_subjectviabuiltassert built.harvested is False, ( "`I know of this file and could not read it` is the claim; `harvested=True` would " "say it was read and declares nothing, which is a different and wrong fact" )observesfile_subjectviabuiltassert "scripts/generate_errors.pl" in {f.path for f in list_files(db, "*.pl")}, ( "the file must also be enumerable, since `search(corpus='files')` is the route a reader " "takes when they do not already know the path" )observeslist_files
Where the product reaches it
main→query_main→_payload→export_search→corpus_payload→_files_corpus→list_files(flow)
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 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-PIPE-012 measured
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-004 measured