6161)
6262
6363
64- class DummyAgentExecutor (AgentExecutor ):
64+ class MockAgentExecutor (AgentExecutor ):
6565 async def execute (self , context : RequestContext , event_queue : EventQueue ):
6666 task_updater = TaskUpdater (
6767 event_queue , context .task_id , context .context_id
@@ -108,7 +108,7 @@ def create_server_call_context() -> ServerCallContext:
108108
109109def test_init_default_dependencies ():
110110 """Test that default dependencies are created if not provided."""
111- agent_executor = DummyAgentExecutor ()
111+ agent_executor = MockAgentExecutor ()
112112 task_store = InMemoryTaskStore ()
113113
114114 handler = DefaultRequestHandler (
@@ -135,7 +135,7 @@ async def test_on_get_task_not_found():
135135 mock_task_store .get .return_value = None
136136
137137 request_handler = DefaultRequestHandler (
138- agent_executor = DummyAgentExecutor (), task_store = mock_task_store
138+ agent_executor = MockAgentExecutor (), task_store = mock_task_store
139139 )
140140
141141 params = GetTaskRequest (name = 'tasks/non_existent_task' )
@@ -157,7 +157,7 @@ async def test_on_cancel_task_task_not_found():
157157 mock_task_store .get .return_value = None
158158
159159 request_handler = DefaultRequestHandler (
160- agent_executor = DummyAgentExecutor (), task_store = mock_task_store
160+ agent_executor = MockAgentExecutor (), task_store = mock_task_store
161161 )
162162 params = CancelTaskRequest (name = 'tasks/task_not_found_for_cancel' )
163163
@@ -1820,7 +1820,7 @@ async def test_cleanup_producer_task_id_not_in_running_agents():
18201820 mock_task_store = AsyncMock (spec = TaskStore )
18211821 mock_queue_manager = AsyncMock (spec = QueueManager )
18221822 request_handler = DefaultRequestHandler (
1823- agent_executor = DummyAgentExecutor (),
1823+ agent_executor = MockAgentExecutor (),
18241824 task_store = mock_task_store ,
18251825 queue_manager = mock_queue_manager ,
18261826 )
@@ -1855,7 +1855,7 @@ async def noop_coro_for_task():
18551855async def test_set_task_push_notification_config_no_notifier ():
18561856 """Test on_set_task_push_notification_config when _push_config_store is None."""
18571857 request_handler = DefaultRequestHandler (
1858- agent_executor = DummyAgentExecutor (),
1858+ agent_executor = MockAgentExecutor (),
18591859 task_store = AsyncMock (spec = TaskStore ),
18601860 push_config_store = None , # Explicitly None
18611861 )
@@ -1886,7 +1886,7 @@ async def test_set_task_push_notification_config_task_not_found():
18861886 mock_push_sender = AsyncMock (spec = PushNotificationSender )
18871887
18881888 request_handler = DefaultRequestHandler (
1889- agent_executor = DummyAgentExecutor (),
1889+ agent_executor = MockAgentExecutor (),
18901890 task_store = mock_task_store ,
18911891 push_config_store = mock_push_store ,
18921892 push_sender = mock_push_sender ,
@@ -1917,7 +1917,7 @@ async def test_set_task_push_notification_config_task_not_found():
19171917async def test_get_task_push_notification_config_no_store ():
19181918 """Test on_get_task_push_notification_config when _push_config_store is None."""
19191919 request_handler = DefaultRequestHandler (
1920- agent_executor = DummyAgentExecutor (),
1920+ agent_executor = MockAgentExecutor (),
19211921 task_store = AsyncMock (spec = TaskStore ),
19221922 push_config_store = None , # Explicitly None
19231923 )
@@ -1941,7 +1941,7 @@ async def test_get_task_push_notification_config_task_not_found():
19411941 mock_push_store = AsyncMock (spec = PushNotificationConfigStore )
19421942
19431943 request_handler = DefaultRequestHandler (
1944- agent_executor = DummyAgentExecutor (),
1944+ agent_executor = MockAgentExecutor (),
19451945 task_store = mock_task_store ,
19461946 push_config_store = mock_push_store ,
19471947 )
@@ -1973,7 +1973,7 @@ async def test_get_task_push_notification_config_info_not_found():
19731973 mock_push_store .get_info .return_value = None # Info not found
19741974
19751975 request_handler = DefaultRequestHandler (
1976- agent_executor = DummyAgentExecutor (),
1976+ agent_executor = MockAgentExecutor (),
19771977 task_store = mock_task_store ,
19781978 push_config_store = mock_push_store ,
19791979 )
@@ -2004,7 +2004,7 @@ async def test_get_task_push_notification_config_info_with_config():
20042004 push_store = InMemoryPushNotificationConfigStore ()
20052005
20062006 request_handler = DefaultRequestHandler (
2007- agent_executor = DummyAgentExecutor (),
2007+ agent_executor = MockAgentExecutor (),
20082008 task_store = mock_task_store ,
20092009 push_config_store = push_store ,
20102010 )
@@ -2051,7 +2051,7 @@ async def test_get_task_push_notification_config_info_with_config_no_id():
20512051 push_store = InMemoryPushNotificationConfigStore ()
20522052
20532053 request_handler = DefaultRequestHandler (
2054- agent_executor = DummyAgentExecutor (),
2054+ agent_executor = MockAgentExecutor (),
20552055 task_store = mock_task_store ,
20562056 push_config_store = push_store ,
20572057 )
@@ -2095,7 +2095,7 @@ async def test_on_subscribe_to_task_task_not_found():
20952095 mock_task_store .get .return_value = None # Task not found
20962096
20972097 request_handler = DefaultRequestHandler (
2098- agent_executor = DummyAgentExecutor (), task_store = mock_task_store
2098+ agent_executor = MockAgentExecutor (), task_store = mock_task_store
20992099 )
21002100 params = SubscribeToTaskRequest (name = 'tasks/resub_task_not_found' )
21012101
@@ -2124,7 +2124,7 @@ async def test_on_subscribe_to_task_queue_not_found():
21242124 mock_queue_manager .tap .return_value = None # Queue not found
21252125
21262126 request_handler = DefaultRequestHandler (
2127- agent_executor = DummyAgentExecutor (),
2127+ agent_executor = MockAgentExecutor (),
21282128 task_store = mock_task_store ,
21292129 queue_manager = mock_queue_manager ,
21302130 )
@@ -2149,7 +2149,7 @@ async def test_on_subscribe_to_task_queue_not_found():
21492149@pytest .mark .asyncio
21502150async def test_on_message_send_stream ():
21512151 request_handler = DefaultRequestHandler (
2152- DummyAgentExecutor (), InMemoryTaskStore ()
2152+ MockAgentExecutor (), InMemoryTaskStore ()
21532153 )
21542154 message_params = SendMessageRequest (
21552155 message = Message (
@@ -2187,7 +2187,7 @@ async def consume_stream():
21872187async def test_list_task_push_notification_config_no_store ():
21882188 """Test on_list_task_push_notification_config when _push_config_store is None."""
21892189 request_handler = DefaultRequestHandler (
2190- agent_executor = DummyAgentExecutor (),
2190+ agent_executor = MockAgentExecutor (),
21912191 task_store = AsyncMock (spec = TaskStore ),
21922192 push_config_store = None , # Explicitly None
21932193 )
@@ -2209,7 +2209,7 @@ async def test_list_task_push_notification_config_task_not_found():
22092209 mock_push_store = AsyncMock (spec = PushNotificationConfigStore )
22102210
22112211 request_handler = DefaultRequestHandler (
2212- agent_executor = DummyAgentExecutor (),
2212+ agent_executor = MockAgentExecutor (),
22132213 task_store = mock_task_store ,
22142214 push_config_store = mock_push_store ,
22152215 )
@@ -2240,7 +2240,7 @@ async def test_list_no_task_push_notification_config_info():
22402240 push_store = InMemoryPushNotificationConfigStore ()
22412241
22422242 request_handler = DefaultRequestHandler (
2243- agent_executor = DummyAgentExecutor (),
2243+ agent_executor = MockAgentExecutor (),
22442244 task_store = mock_task_store ,
22452245 push_config_store = push_store ,
22462246 )
@@ -2274,7 +2274,7 @@ async def test_list_task_push_notification_config_info_with_config():
22742274 await push_store .set_info ('task_1' , push_config2 )
22752275
22762276 request_handler = DefaultRequestHandler (
2277- agent_executor = DummyAgentExecutor (),
2277+ agent_executor = MockAgentExecutor (),
22782278 task_store = mock_task_store ,
22792279 push_config_store = push_store ,
22802280 )
@@ -2300,7 +2300,7 @@ async def test_list_task_push_notification_config_info_with_config_and_no_id():
23002300 push_store = InMemoryPushNotificationConfigStore ()
23012301
23022302 request_handler = DefaultRequestHandler (
2303- agent_executor = DummyAgentExecutor (),
2303+ agent_executor = MockAgentExecutor (),
23042304 task_store = mock_task_store ,
23052305 push_config_store = push_store ,
23062306 )
@@ -2351,7 +2351,7 @@ async def test_list_task_push_notification_config_info_with_config_and_no_id():
23512351async def test_delete_task_push_notification_config_no_store ():
23522352 """Test on_delete_task_push_notification_config when _push_config_store is None."""
23532353 request_handler = DefaultRequestHandler (
2354- agent_executor = DummyAgentExecutor (),
2354+ agent_executor = MockAgentExecutor (),
23552355 task_store = AsyncMock (spec = TaskStore ),
23562356 push_config_store = None , # Explicitly None
23572357 )
@@ -2375,7 +2375,7 @@ async def test_delete_task_push_notification_config_task_not_found():
23752375 mock_push_store = AsyncMock (spec = PushNotificationConfigStore )
23762376
23772377 request_handler = DefaultRequestHandler (
2378- agent_executor = DummyAgentExecutor (),
2378+ agent_executor = MockAgentExecutor (),
23792379 task_store = mock_task_store ,
23802380 push_config_store = mock_push_store ,
23812381 )
@@ -2410,7 +2410,7 @@ async def test_delete_no_task_push_notification_config_info():
24102410 )
24112411
24122412 request_handler = DefaultRequestHandler (
2413- agent_executor = DummyAgentExecutor (),
2413+ agent_executor = MockAgentExecutor (),
24142414 task_store = mock_task_store ,
24152415 push_config_store = push_store ,
24162416 )
@@ -2454,7 +2454,7 @@ async def test_delete_task_push_notification_config_info_with_config():
24542454 await push_store .set_info ('task_2' , push_config1 )
24552455
24562456 request_handler = DefaultRequestHandler (
2457- agent_executor = DummyAgentExecutor (),
2457+ agent_executor = MockAgentExecutor (),
24582458 task_store = mock_task_store ,
24592459 push_config_store = push_store ,
24602460 )
@@ -2494,7 +2494,7 @@ async def test_delete_task_push_notification_config_info_with_config_and_no_id()
24942494 await push_store .set_info ('task_1' , push_config )
24952495
24962496 request_handler = DefaultRequestHandler (
2497- agent_executor = DummyAgentExecutor (),
2497+ agent_executor = MockAgentExecutor (),
24982498 task_store = mock_task_store ,
24992499 push_config_store = push_store ,
25002500 )
@@ -2540,7 +2540,7 @@ async def test_on_message_send_task_in_terminal_state(terminal_state):
25402540 # So we should patch that instead.
25412541
25422542 request_handler = DefaultRequestHandler (
2543- agent_executor = DummyAgentExecutor (), task_store = mock_task_store
2543+ agent_executor = MockAgentExecutor (), task_store = mock_task_store
25442544 )
25452545
25462546 params = SendMessageRequest (
@@ -2585,7 +2585,7 @@ async def test_on_message_send_stream_task_in_terminal_state(terminal_state):
25852585 mock_task_store = AsyncMock (spec = TaskStore )
25862586
25872587 request_handler = DefaultRequestHandler (
2588- agent_executor = DummyAgentExecutor (), task_store = mock_task_store
2588+ agent_executor = MockAgentExecutor (), task_store = mock_task_store
25892589 )
25902590
25912591 params = SendMessageRequest (
@@ -2631,7 +2631,7 @@ async def test_on_subscribe_to_task_in_terminal_state(terminal_state):
26312631 mock_task_store .get .return_value = terminal_task
26322632
26332633 request_handler = DefaultRequestHandler (
2634- agent_executor = DummyAgentExecutor (),
2634+ agent_executor = MockAgentExecutor (),
26352635 task_store = mock_task_store ,
26362636 queue_manager = AsyncMock (spec = QueueManager ),
26372637 )
@@ -2660,7 +2660,7 @@ async def test_on_message_send_task_id_provided_but_task_not_found():
26602660 mock_task_store = AsyncMock (spec = TaskStore )
26612661
26622662 request_handler = DefaultRequestHandler (
2663- agent_executor = DummyAgentExecutor (), task_store = mock_task_store
2663+ agent_executor = MockAgentExecutor (), task_store = mock_task_store
26642664 )
26652665
26662666 params = SendMessageRequest (
@@ -2700,7 +2700,7 @@ async def test_on_message_send_stream_task_id_provided_but_task_not_found():
27002700 mock_task_store = AsyncMock (spec = TaskStore )
27012701
27022702 request_handler = DefaultRequestHandler (
2703- agent_executor = DummyAgentExecutor (), task_store = mock_task_store
2703+ agent_executor = MockAgentExecutor (), task_store = mock_task_store
27042704 )
27052705
27062706 params = SendMessageRequest (
0 commit comments