test_generate_refuses_a_dirty_clew_tree¶
Tests › tests/test_tool_tree_refusal.py
What this test is for
Why it exists
THE TARGET CHECK IS STUBBED so the only reason left to refuse is the clew tree; without that, a missing target checkout would return 1 and this test would pass for the wrong reason.
Given
spent: list[str] = []monkeypatch.setattr(cli, "check_revision", lambda *_a, **_k: None)
3 more
monkeypatch.setattr(cli, "run_cell", lambda cell, *_a, **_k: spent.append(cell.stem()))monkeypatch.setattr(runner, "tool_identity", lambda: {"clew_commit": _SHA, "clew_dirty": True})args = cli.argparse.Namespace( rubric=_MBEDTLS, models=["claude-haiku-5-5"], replicates=1, seed=7, repo=tmp_path / "repo", out=tmp_path / "answers", mcp_config=None, timeout=60, resume=False, )
When
cli.cmd_generate(args)
Then
- ✓ cli.cmd_generate(args) equals 1
- ✓ spent is false
- ✓ capsys.readouterr().err contains "REFUSED"
tests/test_tool_tree_refusal.py:71 · its file's page
What it checks (3)
assert cli.cmd_generate(args) == 1observescmd_generateassert not spent, f"{len(spent)} cell(s) were generated against a modified clew tree"not attributedassert "REFUSED" in capsys.readouterr().errnot 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_generate_refuses_a_dirty_clew_tree→cmd_generateWhat 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 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-PIPE-012 inferred