[Frontend] Add stateless /v1/responses/render endpoint (#50195)
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com> Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
co-authored by
OpenAI Codex
parent
5e6f6a8ed4
commit
6a2a2bb02b
@@ -4,14 +4,19 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from types import SimpleNamespace
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
from openai import OpenAI
|
||||
from openai_harmony import Message, ToolDescription, ToolNamespaceConfig
|
||||
|
||||
import vllm.entrypoints.mcp.tool_server as tool_server_module
|
||||
from tests.utils import RemoteOpenAIServer
|
||||
from vllm.entrypoints.mcp.tool_server import (
|
||||
MCPToolServer,
|
||||
init_tool_server,
|
||||
post_process_tools_description,
|
||||
)
|
||||
|
||||
@@ -39,6 +44,25 @@ _PYTHON_TOOL_INSTRUCTION = (
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_init_tool_server_without_configuration():
|
||||
args = SimpleNamespace(tool_server=None)
|
||||
|
||||
assert await init_tool_server(args) is None
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_init_tool_server_with_mcp_url(monkeypatch: pytest.MonkeyPatch):
|
||||
server = MagicMock()
|
||||
server.add_tool_server = AsyncMock()
|
||||
monkeypatch.setattr(tool_server_module, "MCPToolServer", lambda: server)
|
||||
|
||||
result = await init_tool_server(SimpleNamespace(tool_server="http://mcp.test"))
|
||||
|
||||
assert result is server
|
||||
server.add_tool_server.assert_awaited_once_with("http://mcp.test")
|
||||
|
||||
|
||||
@pytest.mark.skip_global_cleanup
|
||||
class TestMCPToolServerUnit:
|
||||
"""Test MCP tool description processing and filtering.
|
||||
|
||||
Reference in New Issue
Block a user