Fix tests
This commit is contained in:
parent
ada24eaa11
commit
f25a949758
2 changed files with 28 additions and 8 deletions
|
|
@ -304,7 +304,7 @@ async def test_ask_without_cite(app: HaikuRAGApp, monkeypatch):
|
|||
with patch("haiku.rag.app.HaikuRAG", return_value=mock_client):
|
||||
await app.ask("test question")
|
||||
|
||||
mock_client.ask.assert_called_once_with("test question")
|
||||
mock_client.ask.assert_called_once_with("test question", filter=None)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
@ -333,7 +333,7 @@ async def test_ask_with_cite(app: HaikuRAGApp, monkeypatch):
|
|||
with patch("haiku.rag.app.HaikuRAG", return_value=mock_client):
|
||||
await app.ask("test question", cite=True)
|
||||
|
||||
mock_client.ask.assert_called_once_with("test question")
|
||||
mock_client.ask.assert_called_once_with("test question", filter=None)
|
||||
# Verify print was called (once for answer, once for citations)
|
||||
assert mock_print.call_count >= 1
|
||||
|
||||
|
|
@ -353,7 +353,7 @@ async def test_ask_with_verbose(app: HaikuRAGApp, monkeypatch):
|
|||
with patch("haiku.rag.app.HaikuRAG", return_value=mock_client):
|
||||
await app.ask("test question", verbose=True)
|
||||
|
||||
mock_client.ask.assert_called_once_with("test question")
|
||||
mock_client.ask.assert_called_once_with("test question", filter=None)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
|
|||
|
|
@ -279,7 +279,11 @@ def test_ask():
|
|||
|
||||
assert result.exit_code == 0
|
||||
mock_app_instance.ask.assert_called_once_with(
|
||||
question="What is Python?", cite=False, deep=False, verbose=False
|
||||
question="What is Python?",
|
||||
cite=False,
|
||||
deep=False,
|
||||
verbose=False,
|
||||
filter=None,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -293,7 +297,11 @@ def test_ask_with_cite():
|
|||
|
||||
assert result.exit_code == 0
|
||||
mock_app_instance.ask.assert_called_once_with(
|
||||
question="What is Python?", cite=True, deep=False, verbose=False
|
||||
question="What is Python?",
|
||||
cite=True,
|
||||
deep=False,
|
||||
verbose=False,
|
||||
filter=None,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -307,7 +315,11 @@ def test_ask_with_deep():
|
|||
|
||||
assert result.exit_code == 0
|
||||
mock_app_instance.ask.assert_called_once_with(
|
||||
question="What is Python?", cite=False, deep=True, verbose=False
|
||||
question="What is Python?",
|
||||
cite=False,
|
||||
deep=True,
|
||||
verbose=False,
|
||||
filter=None,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -321,7 +333,11 @@ def test_ask_with_deep_and_cite():
|
|||
|
||||
assert result.exit_code == 0
|
||||
mock_app_instance.ask.assert_called_once_with(
|
||||
question="What is Python?", cite=True, deep=True, verbose=False
|
||||
question="What is Python?",
|
||||
cite=True,
|
||||
deep=True,
|
||||
verbose=False,
|
||||
filter=None,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -335,7 +351,11 @@ def test_ask_with_deep_and_verbose():
|
|||
|
||||
assert result.exit_code == 0
|
||||
mock_app_instance.ask.assert_called_once_with(
|
||||
question="What is Python?", cite=False, deep=True, verbose=True
|
||||
question="What is Python?",
|
||||
cite=False,
|
||||
deep=True,
|
||||
verbose=True,
|
||||
filter=None,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue