Skip to content

Commit a1e7bae

Browse files
committed
test: fixed lint warning for incompatible types in assignments and untyped function
1 parent f3bf91b commit a1e7bae

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/server/test_integration.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
Task,
2424
TaskArtifactUpdateEvent,
2525
TaskPushNotificationConfig,
26+
TaskState,
2627
TaskStatus,
2728
TextPart,
2829
UnsupportedOperationError,
@@ -229,11 +230,11 @@ def test_cancel_task(client: TestClient, handler: mock.AsyncMock):
229230
"""Test cancelling a task."""
230231
# Setup mock response
231232
task_status = TaskStatus(**MINIMAL_TASK_STATUS)
232-
task_status.state = 'cancelled'
233+
task_status.state = TaskState.canceled # 'cancelled' #
233234
task = Task(
234235
id='task1', contextId='ctx1', state='cancelled', status=task_status
235236
)
236-
handler.on_cancel_task.return_value = task # JSONRPCResponse(root=task)
237+
handler.on_cancel_task.return_value = task
237238

238239
# Send request
239240
response = client.post(
@@ -250,7 +251,7 @@ def test_cancel_task(client: TestClient, handler: mock.AsyncMock):
250251
assert response.status_code == 200
251252
data = response.json()
252253
assert data['result']['id'] == 'task1'
253-
assert data['result']['status']['state'] == 'cancelled'
254+
assert data['result']['status']['state'] == 'canceled'
254255

255256
# Verify handler was called
256257
handler.on_cancel_task.assert_awaited_once()
@@ -364,7 +365,7 @@ def test_get_push_notification_config(
364365
@pytest.mark.asyncio
365366
async def test_message_send_stream(
366367
app: A2AStarletteApplication, handler: mock.AsyncMock
367-
):
368+
) -> None:
368369
"""Test streaming message sending."""
369370

370371
# Setup mock streaming response
@@ -454,7 +455,7 @@ async def stream_generator():
454455
@pytest.mark.asyncio
455456
async def test_task_resubscription(
456457
app: A2AStarletteApplication, handler: mock.AsyncMock
457-
):
458+
) -> None:
458459
"""Test task resubscription streaming."""
459460

460461
# Setup mock streaming response

0 commit comments

Comments
 (0)