File size: 1,139 Bytes
c44df3b
b616cc1
 
 
 
 
 
 
 
 
 
 
c44df3b
 
 
 
 
 
 
 
8da917e
 
 
 
 
 
 
 
 
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
from app.pipeline.nodes.retrieve import _focused_source_type, _is_capability_query, _normalise_focus_typos


def test_walk_experience_normalises_to_work_experience() -> None:
    assert _normalise_focus_typos("Can you tell me about his walk experience then?") == (
        "can you tell me about his work experience then?"
    )


def test_non_focus_text_is_not_overwritten() -> None:
    original = "Tell me about widget orchestration internals"
    assert _normalise_focus_typos(original) == original.lower()


def test_capability_query_detection_handles_punctuation() -> None:
    assert _is_capability_query("What tech stack does he use?") is True


def test_focus_source_type_for_tech_stack_query() -> None:
    assert _focused_source_type("What technologies and skills does he work with?") == "cv"


def test_focus_source_type_for_professional_work_experience_query() -> None:
    query = "What work experience do you have in a professional setting"
    assert _focused_source_type(query) == "cv"


def test_focus_source_type_for_tech_stack_use_query() -> None:
    assert _focused_source_type("What tech stack does he use") == "cv"