Skip to content

Commit d647d23

Browse files
committed
fix tests
1 parent b6247b6 commit d647d23

2 files changed

Lines changed: 21 additions & 8 deletions

File tree

tests/compat/v0_3/test_jsonrpc_app_compat.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@
1111
from a2a.server.request_handlers.request_handler import RequestHandler
1212
from a2a.types.a2a_pb2 import (
1313
AgentCard,
14+
AgentCapabilities,
15+
AgentInterface,
1416
Message as Message10,
1517
Part as Part10,
1618
Role as Role10,
1719
Task as Task10,
1820
TaskStatus as TaskStatus10,
1921
TaskState as TaskState10,
2022
)
23+
2124
from a2a.compat.v0_3 import a2a_v0_3_pb2
2225

2326

@@ -44,15 +47,21 @@ def mock_handler():
4447

4548
@pytest.fixture
4649
def test_app(mock_handler):
47-
mock_agent_card = MagicMock(spec=AgentCard)
48-
mock_agent_card.url = 'http://mockurl.com'
49-
# Set up capabilities.streaming to avoid validation issues
50-
mock_agent_card.capabilities = MagicMock()
51-
mock_agent_card.capabilities.streaming = False
52-
mock_agent_card.capabilities.push_notifications = True
53-
mock_agent_card.capabilities.extended_agent_card = True
50+
agent_card = AgentCard(
51+
name='TestAgent',
52+
description='Test Description',
53+
version='1.0.0',
54+
capabilities=AgentCapabilities(
55+
streaming=False, push_notifications=True, extended_agent_card=True
56+
),
57+
)
58+
interface = agent_card.supported_interfaces.add()
59+
interface.url = 'http://mockurl.com'
60+
interface.protocol_binding = 'jsonrpc'
61+
interface.protocol_version = '0.3'
62+
5463
jsonrpc_routes = create_jsonrpc_routes(
55-
agent_card=mock_agent_card,
64+
agent_card=agent_card,
5665
request_handler=mock_handler,
5766
enable_v0_3_compat=True,
5867
rpc_url='/',

tests/compat/v0_3/test_jsonrpc_transport.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ async def mock_send_request(data, *args, **kwargs):
363363
'name': 'ExtendedAgent',
364364
'url': 'http://agent',
365365
'version': '1.0.0',
366+
'description': 'Description',
367+
'skills': [],
368+
'defaultInputModes': [],
369+
'defaultOutputModes': [],
366370
'capabilities': {},
367371
'supportsAuthenticatedExtendedCard': True,
368372
}

0 commit comments

Comments
 (0)