Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/test_coverage_antipattern_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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."""
Expand All @@ -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
6 changes: 3 additions & 3 deletions tests/test_coverage_cli_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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):
Expand Down