RICS / backend /tests /test_notes_keyword_router.py
StormShadow308's picture
Add demo documentation and Docker setup for v2 report generation system
aad7814
Raw
History Blame Contribute Delete
951 Bytes
from backend.core.notes_keyword_router import classify_note_by_keywords
def test_chimney_routes_d1():
sid, score = classify_note_by_keywords(
"Chimney stack: Brick chimney with repointing required. TV aerial leaning."
)
assert sid == "D1"
assert score == 1.0
def test_rainwater_routes_d3():
sid, _ = classify_note_by_keywords(
"Rainwater fittings: UPVC gutters and gullies present. Downpipe discharges below ground."
)
assert sid == "D3"
def test_loft_insulation_routes_j1():
sid, _ = classify_note_by_keywords("Loft insulation thin in attic viewed from hatch.")
assert sid == "J1"
def test_slate_routes_d2():
sid, _ = classify_note_by_keywords("Slipped slate tiles on south slope of main roof.")
assert sid == "D2"
def test_nonsense_unassigned():
sid, score = classify_note_by_keywords("xyzzy plugh quantum frobnicator")
assert sid == "UNASSIGNED"
assert score == 0.0