feat(corroboration): treatment classifier + polarity (INV-COR2, X11)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
17
mcp-server/tests/test_corroboration.py
Normal file
17
mcp-server/tests/test_corroboration.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from __future__ import annotations
|
||||
import pytest
|
||||
from legal_mcp.services import corroboration as cor
|
||||
|
||||
@pytest.mark.parametrize("raw,expected", [
|
||||
({"treatment": "followed"}, "followed"),
|
||||
({"treatment": "OVERRULED"}, "overruled"), # case-insensitive
|
||||
({"treatment": "bananas"}, "mentioned"), # unknown -> neutral default
|
||||
({}, "mentioned"), # missing -> neutral default
|
||||
])
|
||||
def test_coerce_treatment(raw, expected):
|
||||
assert cor._coerce_treatment(raw) == expected
|
||||
|
||||
def test_treatment_polarity():
|
||||
assert cor.is_positive("followed") and cor.is_positive("explained")
|
||||
assert cor.is_negative("distinguished") and cor.is_negative("overruled")
|
||||
assert not cor.is_positive("mentioned") and not cor.is_negative("mentioned")
|
||||
Reference in New Issue
Block a user