Fix tests

This commit is contained in:
Yiorgis Gozadinos 2025-10-31 12:50:08 +02:00
parent 9aa8d020e1
commit d19d2b7f00
No known key found for this signature in database
3 changed files with 8 additions and 4 deletions

View file

@ -159,7 +159,7 @@ async def test_search(app: HaikuRAGApp, monkeypatch):
with patch("haiku.rag.app.HaikuRAG", return_value=mock_client):
await app.search("query")
mock_client.search.assert_called_once_with("query", limit=5)
mock_client.search.assert_called_once_with("query", limit=5, filter=None)
assert mock_rich_print_search.call_count == len(mock_results)
@ -176,7 +176,7 @@ async def test_search_no_results(app: HaikuRAGApp, monkeypatch):
with patch("haiku.rag.app.HaikuRAG", return_value=mock_client):
await app.search("query")
mock_client.search.assert_called_once_with("query", limit=5)
mock_client.search.assert_called_once_with("query", limit=5, filter=None)
mock_print.assert_called_once_with("[yellow]No results found.[/yellow]")

View file

@ -170,7 +170,9 @@ def test_search():
result = runner.invoke(cli, ["search", "query"])
assert result.exit_code == 0
mock_app_instance.search.assert_called_once_with(query="query", limit=5)
mock_app_instance.search.assert_called_once_with(
query="query", limit=5, filter=None
)
def test_serve_no_flags():

View file

@ -28,8 +28,10 @@ chunks = [
@pytest.mark.asyncio
async def test_reranker_base():
from haiku.rag.config import Config
reranker = RerankerBase()
assert reranker._model == ""
assert reranker._model == Config.reranking.model
with pytest.raises(NotImplementedError):
await reranker.rerank("query", [])