From c716be96409a03cc91c9ce8b82f2e38ecee1f7ba Mon Sep 17 00:00:00 2001 From: Yiorgis Gozadinos Date: Sat, 25 Jul 2026 15:00:36 +0300 Subject: [PATCH] cover the mcp path with no images --- tests/test_mcp.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_mcp.py b/tests/test_mcp.py index 8f551e51..eda2e2e2 100644 --- a/tests/test_mcp.py +++ b/tests/test_mcp.py @@ -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