From f6e0f1c238ddc0986ac186deb03b62c576431193 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Feb 2026 11:02:21 +0000 Subject: [PATCH] Fix test assertions to match confidence-based atom formatting The _format_atom_line function was refactored (838214c) to use confidence-based framing instead of raw [type|score] tags, but 5 tests still asserted the old format. Update assertions to expect the current output: [KNOWN MISTAKE] for high/critical antipatterns, [warning] for medium, and [type] without score for high-confidence atoms. https://claude.ai/code/session_01TG72k21TVus5BbKxFH3w3v --- tests/test_coverage_antipattern_pipeline.py | 12 ++++++------ tests/test_coverage_cli_hooks.py | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/test_coverage_antipattern_pipeline.py b/tests/test_coverage_antipattern_pipeline.py index 7278c4e..d92704b 100644 --- a/tests/test_coverage_antipattern_pipeline.py +++ b/tests/test_coverage_antipattern_pipeline.py @@ -205,8 +205,8 @@ def test_antipattern_with_severity_and_instead_formats_correctly(self): } line = _format_atom_line(atom) - assert "[antipattern|0.9]" in line - assert "severity: high" in line + assert "[KNOWN MISTAKE]" in line + assert "Never use rm -rf without checking path first" in line assert "instead: Use trash-put or mv to a staging directory" in line assert "(id:42)" in line @@ -220,10 +220,10 @@ def test_antipattern_without_severity_still_formats(self): } line = _format_atom_line(atom) - assert "[antipattern|0.7]" in line + assert "[warning]" in line assert "Watch out for race conditions" in line - # No severity/instead lines. - assert "severity:" not in line + # No instead line. + assert "instead:" not in line def test_high_severity_antipattern_stands_out(self): """Verify the high-severity antipattern format is visually distinct.""" @@ -239,5 +239,5 @@ def test_high_severity_antipattern_stands_out(self): # All critical info should be present for the LLM to parse. assert "Never commit .env files" in line - assert "severity: critical" in line + assert "[KNOWN MISTAKE]" in line assert "instead: Add .env to .gitignore" in line diff --git a/tests/test_coverage_cli_hooks.py b/tests/test_coverage_cli_hooks.py index f0a6ee0..3400a89 100644 --- a/tests/test_coverage_cli_hooks.py +++ b/tests/test_coverage_cli_hooks.py @@ -69,7 +69,7 @@ class TestFormatAtomLine: def test_basic_fact(self): atom = {"type": "fact", "confidence": 0.9, "id": 1, "content": "Python uses GIL"} line = _format_atom_line(atom) - assert "[fact|0.9]" in line + assert "[fact]" in line assert "Python uses GIL" in line assert "(id:1)" in line @@ -80,8 +80,8 @@ def test_antipattern_with_severity(self): "severity": "high", "instead": "Use ast.literal_eval", } line = _format_atom_line(atom) - assert "[antipattern|0.8]" in line - assert "severity: high" in line + assert "[KNOWN MISTAKE]" in line + assert "Don't use eval()" in line assert "instead: Use ast.literal_eval" in line def test_missing_id(self):