cover the mcp path with no images

This commit is contained in:
Yiorgis Gozadinos 2026-07-25 15:00:36 +03:00
parent 081856c6b1
commit c716be9640
No known key found for this signature in database

View file

@ -316,3 +316,19 @@ class TestMCPImageInput:
result = await ask(question="q", images_base64=["!!! not base64 !!!"])
assert "Error" in result
@pytest.mark.asyncio
async def test_ask_question_without_images_passes_none(self, mcp_db, monkeypatch):
captured = {}
async def fake_ask(self, question, filter=None, images=None):
captured["images"] = images
return ("answer", [])
monkeypatch.setattr(HaikuRAG, "ask", fake_ask)
mcp = create_mcp_server(mcp_db, read_only=True)
ask = await _get_tool(mcp, "ask_question")
result = await ask(question="q")
assert result == "answer"
assert captured["images"] is None