The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test(a2a): stub card resolver in create_a2a_client unit tests
milan329202004ef1
diff --git a/tests/test_litellm/proxy/agent_endpoints/test_agent_header_isolation.py b/tests/test_litellm/proxy/agent_endpoints/test_agent_header_isolation.pyindex 5193ad989dc..30095796a7f 100644--- a/tests/test_litellm/proxy/agent_endpoints/test_agent_header_isolation.py+++ b/tests/test_litellm/proxy/agent_endpoints/test_agent_header_isolation.py@@ -245,13 +245,21 @@ def _fake_get_async_httpx_client_factory(captured_calls: list):return _fake_get_async_httpx_client-async def _fake_create_client(base_url, client_config=None, **kwargs):+async def _fake_create_client(agent_card, client_config=None, **kwargs):client = MagicMock()if client_config is not None:client._litellm_httpx_client = client_config.httpx_clientreturn client+def _fake_card_resolver(httpx_client, base_url, **kwargs):+ resolver = MagicMock()+ card = MagicMock()+ card.supported_interfaces = ()+ resolver.get_agent_card = AsyncMock(return_value=card)+ return resolver++@pytest.mark.asyncioasync def test_create_a2a_client_leaves_the_shared_client_untouched():"""@@ -276,6 +284,10 @@ async def test_create_a2a_client_leaves_the_shared_client_untouched():"litellm.a2a_protocol.main.create_client",new=AsyncMock(side_effect=_fake_create_client),),+ patch(+ "litellm.a2a_protocol.main.A2ACardResolver",+ side_effect=_fake_card_resolver,+ ),):await create_a2a_client(base_url="http://agent-a:9999",@@ -321,6 +333,10 @@ async def test_create_a2a_client_default_timeout_matches_constant():"litellm.a2a_protocol.main.create_client",new=AsyncMock(side_effect=_fake_create_client),),+ patch(+ "litellm.a2a_protocol.main.A2ACardResolver",+ side_effect=_fake_card_resolver,+ ),):await create_a2a_client(base_url="http://127.0.0.1:9")@@ -352,6 +368,10 @@ async def test_create_a2a_client_explicit_timeout_overrides_default():"litellm.a2a_protocol.main.create_client",new=AsyncMock(side_effect=_fake_create_client),),+ patch(+ "litellm.a2a_protocol.main.A2ACardResolver",+ side_effect=_fake_card_resolver,+ ),):await create_a2a_client(base_url="http://127.0.0.1:9", timeout=42.5)