test_draft_becomes_a_statable_option_without_a_file¶
Tests › tests/test_propose.py
What this test is for
Why it exists
gh#360. The test above proves the draft parses when an owner ACTIVATES IT IN A FILE; this proves the other route exists at all. An agent has nowhere to write that file — a third-party repo must stay byte-identical, and anywhere else is untracked or `git clean`ed — so before this, `propose_declaration` returned prose and `options` took a structure, with no path between them.
Given
root, db = _acme(tmp_path)
When
proposal = propose(root, db)active = tmp_path / "activated"active.mkdir()
5 more
(active / DECLARATION_NAME).write_text(uncomment(proposal.yaml_text), encoding="utf-8")statement = statement_from_draft(proposal.yaml_text)load_declaration(active)args = SimpleNamespace(**dict.fromkeys(statement))apply_options(args, statement, root)
Then
- ✓ _section(proposal, SECTION_SHARED_KEY).status is SectionStatus.PROPOSED
- ✓ statement equals load_declaration(active)
- ✓ apply_options(args, statement, root) equals sorted(statement)
- ✓ getattr(args, SECTION_SHARED_KEY)["writers"] equals [{"name_prefix": "ACME_SET_"}]
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:534 · its file's page
What it checks (4)
assert _section(proposal, SECTION_SHARED_KEY).status is SectionStatus.PROPOSEDobserves_sectionassert statement == load_declaration(active), "one proposal, two spellings of it"observesload_declarationassert apply_options(args, statement, root) == sorted(statement)observesapply_optionsassert getattr(args, SECTION_SHARED_KEY)["writers"] == [{"name_prefix": "ACME_SET_"}]not attributed
Where the product reaches it
Call flow
test_draft_becomes_a_statable_option_without_a_file→_acme→propose→_section→uncomment→statement_from_draft→load_declaration→apply_optionsWhat 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 15 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-CONFIG-008 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