test_unresolved_fields_column_is_null_when_nothing_is_unresolved¶
Tests › tests/test_datamodel.py
What this test is for
Why it exists
NULL, NOT AN EMPTY STRING, so that a consumer's test for "unresolved" is the same NULL test every other optional column here takes. An empty string would be a value that looks declared and is not — the same defect `_scalar` avoids one column over.
Given
root = _repo(tmp_path, {"widgetbus_001.yaml": UDM_MANIFEST}, UDM_DEFINES)db = tmp_path / "clew.db"
When
import_data_model_keys(db, root)conn = sqlite3.connect(str(db))try: rows = dict(conn.execute("SELECT key_id, unresolved_fields FROM data_model_keys")) dialects = {r[0] for r in conn.execute("SELECT DISTINCT dialect FROM data_model_keys")} finally: conn.close()
Then
- ✓ rows equals { "Sample of Rate": "default_value", "Mode_Select": "default_value,enum_set", "Uptime": None, }
- ✓ dialects equals {DIALECT_UDM}
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
… 126 later steps
2 more
- Build, refresh and check the index · 4 of 153 steps
- clew — `main` (clew/cli.py) · 4 of 400 steps
tests/test_datamodel.py:691 · its file's page
What it checks (2)
assert rows == { "Sample of Rate": "default_value", "Mode_Select": "default_value,enum_set", "Uptime": None, }not attributedassert dialects == {DIALECT_UDM}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
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 6 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-INDEX-005 measured
- REQ-DDB-PIPE-003 measured
- REQ-DDB-SCHEMA-012 measured
- REQ-DDB-SCHEMA-013 measured