Files
searchbox/tests/test_mcp/test_qdrant_mcp.py
2025-09-30 23:06:33 +00:00

31 lines
770 B
Python

import json
import pytest
from fastmcp import Client
from searchbox.mcp_server.server import mcp
@pytest.fixture
async def mcp_client():
async with Client(mcp) as client:
yield client
async def test_mcp_qdrant_backend(mcp_client):
"""Test MCP server with automatic Azure embedding."""
result = await mcp_client.call_tool(
name="get_information",
arguments={
"query": "Quien es el mas guapo",
"collection": "azure_collection",
},
)
content = json.loads(result.content[0].text)[0]
assert content["score"] >= 0.65
assert content["payload"]["page_content"] == "Rick es el mas guapo"
assert content["payload"]["filename"] == "test.txt"
assert content["payload"]["page"] == 1