test_import_shared_key_edges_declared_event_edge¶
Tests › tests/test_build_docs_db.py
What this test is for
Given
db_path = _make_shared_key_db( tmp_path, [(1, "handle_ping_cmd", 1, 3), (2, "handle_sound_event_findme", 5, 8)], )data_model_path = tmp_path / "data_model.toml"data_model_path.write_text( """ [[keys]] name = "ROBOT_SOUND_EVENT_TYPE" persistent = false event = true writers = ["handle_ping_cmd"] readers = ["handle_sound_event_findme"] """, )
When
import_shared_key_edges_declared(db_path, data_model_path)conn = sqlite3.connect(str(db_path))rows = conn.execute( "SELECT writer_rowid, reader_rowid, key_name, edge_kind, declared, " "source, confidence FROM shared_key_edges", ).fetchall()conn.close()
Then
- ✓ rows equals [ (1, 2, "ROBOT_SOUND_EVENT_TYPE", "event", 1, "shared_key_declared", "high"), ]
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.
Build this wiki from the index · 1 of 400 steps
… 96 earlier steps
… 299 later steps
1 more
- `main` (clew/guard/main.py) · 1 of 357 steps
tests/test_build_docs_db.py:1934 · its file's page
What it checks (1)
assert rows == [ (1, 2, "ROBOT_SOUND_EVENT_TYPE", "event", 1, "shared_key_declared", "high"), ]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
test_import_shared_key_edges_declared_event_edge→_make_shared_key_db→import_shared_key_edges_declaredWhat 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 (2)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-001 | catalog | unknown |
| REQ-DDB-PIPE-010 | catalog | unknown |
Also reaches 5 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-QUERY-003 measured
- REQ-DDB-SCHEMA-002 measured
- REQ-DDB-SCHEMA-005 measured
- REQ-DDB-SCHEMA-007 measured
- REQ-DDB-SCHEMA-012 measured