mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
chore: update test assumption, docs
This commit is contained in:
@@ -315,7 +315,7 @@ agent = Agent(
|
||||
a2a=A2AConfig(
|
||||
endpoint="https://research.example.com/.well-known/agent-card.json",
|
||||
updates=PushNotificationConfig(
|
||||
url="https://your-server.com/webhook",
|
||||
url={base_url}/a2a/callback",
|
||||
token="your-validation-token",
|
||||
timeout=300.0
|
||||
)
|
||||
|
||||
@@ -172,12 +172,12 @@ class TestA2APushNotificationHandler:
|
||||
)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_push_handler_registers_callback_and_waits(
|
||||
async def test_push_handler_waits_for_result(
|
||||
self,
|
||||
mock_agent_card: AgentCard,
|
||||
mock_task,
|
||||
) -> None:
|
||||
"""Test that push handler registers callback and waits for result."""
|
||||
"""Test that push handler waits for result from store."""
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
from a2a.types import Task, TaskStatus
|
||||
@@ -201,7 +201,6 @@ class TestA2APushNotificationHandler:
|
||||
|
||||
mock_client = MagicMock()
|
||||
mock_client.send_message = mock_send_message
|
||||
mock_client.set_task_callback = AsyncMock()
|
||||
|
||||
config = PushNotificationConfig(
|
||||
url=AnyHttpUrl("http://localhost:8080/a2a/callback"),
|
||||
@@ -228,7 +227,6 @@ class TestA2APushNotificationHandler:
|
||||
polling_interval=1.0,
|
||||
)
|
||||
|
||||
mock_client.set_task_callback.assert_called_once()
|
||||
mock_store.wait_for_result.assert_called_once_with(
|
||||
task_id="task-123",
|
||||
timeout=30.0,
|
||||
@@ -265,7 +263,6 @@ class TestA2APushNotificationHandler:
|
||||
|
||||
mock_client = MagicMock()
|
||||
mock_client.send_message = mock_send_message
|
||||
mock_client.set_task_callback = AsyncMock()
|
||||
|
||||
config = PushNotificationConfig(
|
||||
url=AnyHttpUrl("http://localhost:8080/a2a/callback"),
|
||||
|
||||
Reference in New Issue
Block a user