feat(notes): _strip_type_nouns helper for search query sanitization
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -28,3 +28,29 @@ async def test_search_projects_tool_returns_success_true():
|
||||
assert result["success"] is True
|
||||
assert result["type"] == "projects_list"
|
||||
assert len(result["data"]["projects"]) == 1
|
||||
|
||||
|
||||
def test_strip_type_nouns_removes_task_word():
|
||||
from fabledassistant.services.notes import _strip_type_nouns
|
||||
assert _strip_type_nouns("sebring secondary task") == ["sebring", "secondary"]
|
||||
|
||||
|
||||
def test_strip_type_nouns_removes_all_variants():
|
||||
from fabledassistant.services.notes import _strip_type_nouns
|
||||
assert _strip_type_nouns("project notes task") == []
|
||||
|
||||
|
||||
def test_strip_type_nouns_case_insensitive():
|
||||
from fabledassistant.services.notes import _strip_type_nouns
|
||||
assert _strip_type_nouns("Sebring Task NOTES") == ["Sebring"]
|
||||
|
||||
|
||||
def test_strip_type_nouns_preserves_real_content_words():
|
||||
from fabledassistant.services.notes import _strip_type_nouns
|
||||
assert _strip_type_nouns("circuit configuration") == ["circuit", "configuration"]
|
||||
|
||||
|
||||
def test_strip_type_nouns_handles_empty_string():
|
||||
from fabledassistant.services.notes import _strip_type_nouns
|
||||
assert _strip_type_nouns("") == []
|
||||
assert _strip_type_nouns(" ") == []
|
||||
|
||||
Reference in New Issue
Block a user