test_list_files_inventory

Tests › tests/test_query.py

passed Passed in the packaged run.

What this test is for

Why it exists

Every real source file is listed with a symbol count; doxygen's synthetic bracket rows ('[STL]', '[generated]') are not files and must not appear.

Verifies REQ-DDB-QUERY-002

Given

  1. —
→

When

  1. files = q.list_files(rich_db)
  2. paths = [f.path for f in files]
→

Then

  1. ✓ paths equals sorted(paths)
  2. ✓ [p for p in paths if p.startswith("[")] is false
  3. ✓ any(p.endswith("sensor_driver.c") for p in paths) holds
  4. ✓ any(f.symbol_count > 0 for f in files) holds

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

2 more

tests/test_query.py:882 · its file's page

What it checks (4)

  1. assert paths == sorted(paths) not attributed
  2. assert not [p for p in paths if p.startswith("[")], "synthetic path rows must be excluded" not attributed
  3. assert any(p.endswith("sensor_driver.c") for p in paths) not attributed
  4. assert any(f.symbol_count > 0 for f in files) observes list_files via files

Where the product reaches it

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

Call flow

test_list_files_inventory→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_list_files_inventory · 4 checkslist_filesREQ-DDB-QUERY-001 · measuredlist_filestable_existsREQ-DDB-QUERY-003 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-QUERY-002catalogunknown
Also reaches 2 requirements

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