test_observed_flag_joins_the_shared_key_layer

Tests › tests/test_datamodel.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE THIRD GAIN, and the reason the stage runs below the shared-key stages rather than beside them. Run above and every row reads `observed = 0`, which is a plausible answer — a repository touching none of its own data model — rather than an obviously wrong one.

Given

  1. root = _repo(tmp_path, {"widgetbus.toml": MANIFEST}, DEFINES)
  2. db = tmp_path / "clew.db"
5 more
  1. conn = sqlite3.connect(str(db))
  2. conn.execute("CREATE TABLE shared_key_edges (key_name TEXT)")
  3. conn.execute("INSERT INTO shared_key_edges VALUES (?)", (DEFINES[1],))
  4. conn.commit()
  5. conn.close()
→

When

  1. import_data_model_keys(db, root)
  2. conn = sqlite3.connect(str(db))
  3. try: rows = dict(conn.execute("SELECT define_name, observed FROM data_model_keys")) finally: conn.close()
→

Then

  1. ✓ rows equals {DEFINES[0]: 0, DEFINES[1]: 1, DEFINES[2]: 0}

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.

thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 4 of 142 steps

… 8 earlier steps

thread startthread startthread startthread startclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesopt (line 845)optloop (line 1239)loopopt (line 847)optloop (line 746)loop_first_build_worker9. whole_repo_scope → list9list10. whole_repo_scope → nested_repo_roots10nested_repo_roots11. nested_repo_roots → _nested_repos_under11_nested_repos_under▶ test enters12–14. _nested_repos_under → _warn_unwalkable12_warn_unwalkable +2 more15. nested_repo_roots → _nested_repos_under15_nested_repos_under16. whole_repo_scope → _gitignored_paths16_gitignored_paths

… 126 later steps

2 more

tests/test_datamodel.py:792 · its file's page

What it checks (1)

  1. assert rows == {DEFINES[0]: 0, DEFINES[1]: 1, DEFINES[2]: 0} 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_observed_flag_joins_the_shared_key_layer→_repo→import_data_model_keys

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_observed_flag_joins_the_shared_key_layer · 1 checksimport_data_model_keysREQ-DDB-SCHEMA-013 · measured
Also reaches 6 requirements

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