fix(evidence): stabilize real Pi authoring
This commit is contained in:
@@ -14,6 +14,32 @@ def test_evidence_authoring_commands_are_distinct_from_runtime_preprocessing():
|
||||
assert "validate" in result.output
|
||||
|
||||
|
||||
def test_evidence_prepare_failure_identifies_the_source_file(monkeypatch, tmp_path):
|
||||
from tht.cli import evidence_cmd
|
||||
from tht.evidence import EvidencePreparationError
|
||||
|
||||
monkeypatch.setattr(evidence_cmd, "_canonical_worktree", lambda root: root)
|
||||
monkeypatch.setattr(
|
||||
evidence_cmd,
|
||||
"prepare_workspace_evidence",
|
||||
lambda *args, **kwargs: (_ for _ in ()).throw(
|
||||
EvidencePreparationError("pi_restructure_invalid", "source/domain/patient.md")
|
||||
),
|
||||
)
|
||||
|
||||
result = CliRunner().invoke(app, ["evidence", "prepare", str(tmp_path), "--json"])
|
||||
|
||||
assert result.exit_code == 1
|
||||
assert result.stderr == ""
|
||||
assert json.loads(result.stdout) == {
|
||||
"code": "pi_restructure_invalid",
|
||||
"operation": "evidence_prepare",
|
||||
"schemaVersion": 1,
|
||||
"sourceFile": "source/domain/patient.md",
|
||||
"status": "failed",
|
||||
}
|
||||
|
||||
|
||||
def test_evidence_resolve_json_is_pristine(monkeypatch, tmp_path):
|
||||
from tht.cli import evidence_cmd
|
||||
from tht.evidence.authoring import EvidenceResolutionReport
|
||||
|
||||
Reference in New Issue
Block a user