test_rendered_draft_round_trips_through_load_declaration¶
Tests › tests/test_propose.py
What this test is for
Why it exists
A draft that does not parse is useless, and every emitted line is a comment — so the only way to prove the proposal is real is to perform the activation an owner would perform and load the result through the SAME code path a build uses.
Given
root, db = _acme(tmp_path)
When
proposal = propose(root, db)shared = _section(proposal, SECTION_SHARED_KEY)target = tmp_path / "inert"
7 more
target.mkdir()(target / DECLARATION_NAME).write_text(proposal.yaml_text, encoding="utf-8")load_declaration(target)active = tmp_path / "active"active.mkdir()(active / DECLARATION_NAME).write_text(uncomment(proposal.yaml_text), encoding="utf-8")declared = load_declaration(active)
Then
- ✓ shared.status is SectionStatus.PROPOSED
- ✓ load_declaration(target) equals {}
- ✓ set(declared) equals {SECTION_SHARED_KEY}
- ✓ declared[SECTION_SHARED_KEY]["writers"] equals [{"name_prefix": "ACME_SET_"}]
- ✓ declared[SECTION_SHARED_KEY]["readers"] equals [{"name_prefix": "ACME_GET_"}]
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) · 98 of 400 steps
… 3 earlier steps
… 14 steps between
… 15 steps between
… 248 later steps
4 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 16 of 142 steps
- Build this wiki from the index · 11 of 400 steps
- Build, refresh and check the index · 2 of 153 steps
- `main` (clew/guard/main.py) · 2 of 357 steps
tests/test_propose.py:502 · its file's page
What it checks (5)
assert shared.status is SectionStatus.PROPOSED, shared.reasonobserves_sectionviasharedassert load_declaration(target) == {}observesload_declarationassert set(declared) == {SECTION_SHARED_KEY}observesload_declarationviadeclaredassert declared[SECTION_SHARED_KEY]["writers"] == [{"name_prefix": "ACME_SET_"}]observesload_declarationviadeclaredassert declared[SECTION_SHARED_KEY]["readers"] == [{"name_prefix": "ACME_GET_"}]observesload_declarationviadeclared
Where the product reaches it
Call flow
test_rendered_draft_round_trips_through_load_declaration→load_declaration→_acme→propose→_section→uncommentWhat 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 14 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-GUARD-012 inferred
- REQ-DDB-PIPE-003 measured
- REQ-DDB-PIPE-005 measured
- REQ-DDB-PIPE-010 measured
- REQ-DDB-PIPE-011 measured
- REQ-DDB-PIPE-012 inferred
- REQ-DDB-SCHEMA-002 measured
- REQ-DDB-SCHEMA-005 measured
- REQ-DDB-SCHEMA-007 measured
- REQ-DDB-SCHEMA-012 measured
- REQ-DDB-WIKI-054 inferred