Skip to content
Prev Previous commit
Next Next commit
Remove more tests
  • Loading branch information
holtskinner committed Jun 11, 2025
commit 694eb63e2f1c0373aa384ff1be10a8f07de8c53d
48 changes: 0 additions & 48 deletions tests/utils/test_proto_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from a2a import types
from a2a.grpc import a2a_pb2
from a2a.utils import proto_utils
from a2a.utils.errors import ServerError


# --- Test Data ---
Expand Down Expand Up @@ -95,9 +94,9 @@
'httpAuth': types.SecurityScheme(
root=types.HTTPAuthSecurityScheme(scheme='bearer')
),
'oidc': types.SecurityScheme(

Check failure on line 97 in tests/utils/test_proto_utils.py

View workflow job for this annotation

GitHub Actions / Check Spelling

`oidc` is not a recognized word. (unrecognized-spelling)
root=types.OpenIdConnectSecurityScheme(
openIdConnectUrl='http://oidc.url'

Check failure on line 99 in tests/utils/test_proto_utils.py

View workflow job for this annotation

GitHub Actions / Check Spelling

`oidc` is not a recognized word. (unrecognized-spelling)

Check warning on line 99 in tests/utils/test_proto_utils.py

View workflow job for this annotation

GitHub Actions / Check Spelling

`oidc` is not a recognized word. (unrecognized-spelling)
)
),
},
Expand All @@ -119,17 +118,6 @@
roundtrip_msg = proto_utils.FromProto.message(proto_msg)
assert roundtrip_msg == sample_message

def test_roundtrip_agent_card(self, sample_agent_card: types.AgentCard):
"""Test conversion of AgentCard to proto and back."""
proto_card = proto_utils.ToProto.agent_card(sample_agent_card)
assert isinstance(proto_card, a2a_pb2.AgentCard)

roundtrip_card = proto_utils.FromProto.agent_card(proto_card)
# Pydantic models with nested dicts/lists might not be equal after roundtrip, so check fields
assert roundtrip_card.name == sample_agent_card.name
assert roundtrip_card.provider == sample_agent_card.provider
assert roundtrip_card.skills == sample_agent_card.skills

def test_enum_conversions(self):
"""Test conversions for all enum types."""
assert (
Expand Down Expand Up @@ -162,42 +150,6 @@
== a2a_pb2.TaskState.TASK_STATE_UNSPECIFIED
)

def test_task_id_params_parsing(self):
"""Test parsing of task and push notification config names."""
cancel_req = a2a_pb2.CancelTaskRequest(name='tasks/task-123')
params = proto_utils.FromProto.task_id_params(cancel_req)
assert params.id == 'task-123'

push_req = a2a_pb2.GetTaskPushNotificationRequest(
name='tasks/task-456/pushNotifications/config-789'
)
params_push = proto_utils.FromProto.task_id_params(push_req)
assert params_push.id == 'task-456'

with pytest.raises(ServerError):
proto_utils.FromProto.task_id_params(
a2a_pb2.CancelTaskRequest(name='invalid/name')
)

with pytest.raises(ServerError):
proto_utils.FromProto.task_id_params(
a2a_pb2.GetTaskPushNotificationRequest(name='invalid/name')
)

def test_task_query_params_parsing(self):
"""Test parsing of GetTaskRequest."""
get_req = a2a_pb2.GetTaskRequest(
name='tasks/task-abc', history_length=10
)
params = proto_utils.FromProto.task_query_params(get_req)
assert params.id == 'task-abc'
assert params.historyLength == 10

with pytest.raises(ServerError):
proto_utils.FromProto.task_query_params(
a2a_pb2.GetTaskRequest(name='invalid/name')
)

def test_oauth_flows_conversion(self):
"""Test conversion of different OAuth2 flows."""
# Test password flow
Expand Down
Loading