feat(review): render walkthrough + risk_verdict + test_coverage

This commit is contained in:
claude
2026-08-22 00:58:51 +00:00
parent 66628aae8d
commit 979c93bdbb
2 changed files with 73 additions and 0 deletions
+37
View File
@@ -859,6 +859,43 @@ def test_format_review_body_with_summary_changes_and_risks():
assert "`a.py:1`" in body
def test_format_review_body_renders_walkthrough():
body = format_review_body(
"", "glm-5.2:cloud", "abc1234",
summary_changes=["adds X"],
risks=[],
walkthrough=["a.py — adds X", "b.py — refactors Y"],
risk_verdict="Low risk: clean.",
test_coverage="Tests added.",
findings_for_table=[],
)
assert "### Walkthrough" in body
assert "`a.py` — adds X" in body
assert "### Risk Verdict" in body
assert "Low risk: clean." in body
assert "### Test Coverage" in body
assert "Tests added." in body
def test_format_review_body_omits_empty_sections():
body = format_review_body(
"", "glm-5.2:cloud", "abc1234",
summary_changes=["adds X"],
walkthrough=[], risk_verdict="", test_coverage="",
)
assert "### Walkthrough" not in body
assert "### Risk Verdict" not in body
assert "### Test Coverage" not in body
def test_format_review_body_placeholder_when_empty():
body = format_review_body(
"", "glm-5.2:cloud", "abc1234",
walkthrough=[], risk_verdict="", test_coverage="",
)
assert body # non-empty
def test_render_collapsible_usage_contains_details():
usage = {
"model": "glm-5.2:cloud", "input": 1000, "output": 200, "reasoning": 0,