test_the_registered_file_answers_as_a_file_subject

Tests › tests/test_unparsed_file_registration.py

passed Passed in the packaged run.

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

  1. db = tmp_path / "clew.db"
  2. conn = sqlite3.connect(str(db))
3 more
  1. conn.execute( "CREATE TABLE path (rowid INTEGER PRIMARY KEY, type INTEGER, local INTEGER, " "found INTEGER, name TEXT)" )
  2. conn.commit()
  3. conn.close()
→

When

  1. register_paths(db, ["scripts/generate_errors.pl"])
  2. conn = sqlite3.connect(str(db))
  3. 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()
  4. list_files(db, "*.pl")
→

Then

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

command-line usercommand-line usercommand-line usercommand-line userclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyloop (line 1576)loopmain216. _memberdef_corpora → _expansion_sql216_expansion_sql217. _expansion_sql → has_columns217has_columns218. has_columns → table_exists218table_exists219. _memberdef_corpora → _memberdef_candidates219_memberdef_candidates220. _memberdef_candidates → table_exists220table_exists

… 119 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyother filesother filesother filesother filesopt (line 504)optmain340. _files_corpus → one340one341. _files_corpus → list_files341list_files342. list_files → connect342connect▶ test enters343. list_files → has_columns343has_columns344. list_files → table_exists344table_exists345. list_files → _matches345_matches346. _files_corpus → files_miss346files_miss347. corpus_payload → lock_roster347lock_roster

… 53 later steps

3 more

tests/test_unparsed_file_registration.py:128 · its file's page

What it checks (4)

  1. assert built is not None, "the mark wants this name findable; a miss is the old answer" observes file_subject via built
  2. assert built.symbol_count == 0 observes file_subject via built
  3. 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" ) observes file_subject via built
  4. assert "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" ) observes list_files

Where the product reaches it

  • main → query_main → _payload → export_search → corpus_payload → _files_corpus → list_files (flow)

Call flow

test_the_registered_file_answers_as_a_file_subject→file_subject→register_paths→list_files

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.

test_the_registered_file_answers_as_a_file_subject · 4 checksregister_pathsREQ-DDB-PIPE-012 · measuredlist_filesREQ-DDB-QUERY-001 · measuredlist_filestable_existsREQ-DDB-QUERY-003 · measuredfile_subjectREQ-DDB-QUERY-004 · measured
Also reaches 4 requirements

Its run touches their code; that is reach, not proof.