File size: 951 Bytes
aad7814
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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