@@ -147,7 +147,9 @@ async def test_on_get_task_not_found():
147147 await request_handler .on_get_task (params , context )
148148
149149 assert isinstance (exc_info .value .error , TaskNotFoundError )
150- mock_task_store .get .assert_awaited_once_with ('non_existent_task' , context )
150+ mock_task_store .get .assert_awaited_once_with (
151+ 'tasks/non_existent_task' , context
152+ )
151153
152154
153155@pytest .mark .asyncio
@@ -169,7 +171,7 @@ async def test_on_cancel_task_task_not_found():
169171
170172 assert isinstance (exc_info .value .error , TaskNotFoundError )
171173 mock_task_store .get .assert_awaited_once_with (
172- 'task_not_found_for_cancel' , context
174+ 'tasks/ task_not_found_for_cancel' , context
173175 )
174176
175177
@@ -212,7 +214,7 @@ async def test_on_cancel_task_queue_tap_returns_none():
212214 params = CancelTaskRequest (id = 'tasks/tap_none_task' )
213215 result_task = await request_handler .on_cancel_task (params , context )
214216
215- mock_task_store .get .assert_awaited_once_with ('tap_none_task' , context )
217+ mock_task_store .get .assert_awaited_once_with ('tasks/ tap_none_task' , context )
216218 mock_queue_manager .tap .assert_awaited_once_with ('tap_none_task' )
217219 # agent_executor.cancel should be called with a new EventQueue if tap returned None
218220 mock_agent_executor .cancel .assert_awaited_once ()
@@ -932,7 +934,7 @@ async def test_on_get_task_limit_history():
932934 assert isinstance (result , Task )
933935
934936 get_task_result = await request_handler .on_get_task (
935- GetTaskRequest (id = f'tasks/ { result .id } ' , history_length = 1 ),
937+ GetTaskRequest (id = result .id , history_length = 1 ),
936938 create_server_call_context (),
937939 )
938940 assert get_task_result is not None
@@ -1901,7 +1903,9 @@ async def test_set_task_push_notification_config_task_not_found():
19011903 )
19021904
19031905 assert isinstance (exc_info .value .error , TaskNotFoundError )
1904- mock_task_store .get .assert_awaited_once_with ('non_existent_task' , context )
1906+ mock_task_store .get .assert_awaited_once_with (
1907+ 'tasks/non_existent_task' , context
1908+ )
19051909 mock_push_store .set_info .assert_not_awaited ()
19061910
19071911
@@ -1950,7 +1954,9 @@ async def test_get_task_push_notification_config_task_not_found():
19501954 )
19511955
19521956 assert isinstance (exc_info .value .error , TaskNotFoundError )
1953- mock_task_store .get .assert_awaited_once_with ('non_existent_task' , context )
1957+ mock_task_store .get .assert_awaited_once_with (
1958+ 'tasks/non_existent_task' , context
1959+ )
19541960 mock_push_store .get_info .assert_not_awaited ()
19551961
19561962
@@ -1984,8 +1990,10 @@ async def test_get_task_push_notification_config_info_not_found():
19841990 assert isinstance (
19851991 exc_info .value .error , InternalError
19861992 ) # Current code raises InternalError
1987- mock_task_store .get .assert_awaited_once_with ('non_existent_task' , context )
1988- mock_push_store .get_info .assert_awaited_once_with ('non_existent_task' )
1993+ mock_task_store .get .assert_awaited_once_with (
1994+ 'tasks/non_existent_task' , context
1995+ )
1996+ mock_push_store .get_info .assert_awaited_once_with ('tasks/non_existent_task' )
19891997
19901998
19911999@pytest .mark .asyncio
@@ -2025,7 +2033,7 @@ async def test_get_task_push_notification_config_info_with_config():
20252033 )
20262034
20272035 assert result is not None
2028- assert result .task_id == 'task_1'
2036+ assert result .task_id == 'tasks/ task_1'
20292037 assert result .push_notification_config .url == set_config_params .config .url
20302038 assert result .push_notification_config .id == 'config_id'
20312039
@@ -2054,7 +2062,7 @@ async def test_get_task_push_notification_config_info_with_config_no_id():
20542062 )
20552063
20562064 params = GetTaskPushNotificationConfigRequest (
2057- task_id = 'tasks/task_1' , id = 'task_1'
2065+ task_id = 'tasks/task_1' , id = 'tasks/ task_1'
20582066 )
20592067
20602068 result : TaskPushNotificationConfig = (
@@ -2064,9 +2072,9 @@ async def test_get_task_push_notification_config_info_with_config_no_id():
20642072 )
20652073
20662074 assert result is not None
2067- assert result .task_id == 'task_1'
2075+ assert result .task_id == 'tasks/ task_1'
20682076 assert result .push_notification_config .url == set_config_params .config .url
2069- assert result .push_notification_config .id == 'task_1'
2077+ assert result .push_notification_config .id == 'tasks/ task_1'
20702078
20712079
20722080@pytest .mark .asyncio
@@ -2090,7 +2098,7 @@ async def test_on_subscribe_to_task_task_not_found():
20902098
20912099 assert isinstance (exc_info .value .error , TaskNotFoundError )
20922100 mock_task_store .get .assert_awaited_once_with (
2093- 'resub_task_not_found' , context
2101+ 'tasks/ resub_task_not_found' , context
20942102 )
20952103
20962104
@@ -2122,7 +2130,7 @@ async def test_on_subscribe_to_task_queue_not_found():
21222130 exc_info .value .error , TaskNotFoundError
21232131 ) # Should be TaskNotFoundError as per spec
21242132 mock_task_store .get .assert_awaited_once_with (
2125- 'resub_queue_not_found' , context
2133+ 'tasks/ resub_queue_not_found' , context
21262134 )
21272135 mock_queue_manager .tap .assert_awaited_once_with ('resub_queue_not_found' )
21282136
@@ -2206,7 +2214,9 @@ async def test_list_task_push_notification_config_task_not_found():
22062214 )
22072215
22082216 assert isinstance (exc_info .value .error , TaskNotFoundError )
2209- mock_task_store .get .assert_awaited_once_with ('non_existent_task' , context )
2217+ mock_task_store .get .assert_awaited_once_with (
2218+ 'tasks/non_existent_task' , context
2219+ )
22102220 mock_push_store .get_info .assert_not_awaited ()
22112221
22122222
@@ -2251,8 +2261,8 @@ async def test_list_task_push_notification_config_info_with_config():
22512261 )
22522262
22532263 push_store = InMemoryPushNotificationConfigStore ()
2254- await push_store .set_info ('task_1' , push_config1 )
2255- await push_store .set_info ('task_1' , push_config2 )
2264+ await push_store .set_info ('tasks/ task_1' , push_config1 )
2265+ await push_store .set_info ('tasks/ task_1' , push_config2 )
22562266
22572267 request_handler = DefaultRequestHandler (
22582268 agent_executor = MockAgentExecutor (),
@@ -2266,9 +2276,9 @@ async def test_list_task_push_notification_config_info_with_config():
22662276 )
22672277
22682278 assert len (result .configs ) == 2
2269- assert result .configs [0 ].task_id == 'task_1'
2279+ assert result .configs [0 ].task_id == 'tasks/ task_1'
22702280 assert result .configs [0 ].push_notification_config == push_config1
2271- assert result .configs [1 ].task_id == 'task_1'
2281+ assert result .configs [1 ].task_id == 'tasks/ task_1'
22722282 assert result .configs [1 ].push_notification_config == push_config2
22732283
22742284
@@ -2312,12 +2322,12 @@ async def test_list_task_push_notification_config_info_with_config_and_no_id():
23122322 )
23132323
23142324 assert len (result .configs ) == 1
2315- assert result .configs [0 ].task_id == 'task_1'
2325+ assert result .configs [0 ].task_id == 'tasks/ task_1'
23162326 assert (
23172327 result .configs [0 ].push_notification_config .url
23182328 == set_config_params2 .config .url
23192329 )
2320- assert result .configs [0 ].push_notification_config .id == 'task_1'
2330+ assert result .configs [0 ].push_notification_config .id == 'tasks/ task_1'
23212331
23222332
23232333@pytest .mark .asyncio
@@ -2364,7 +2374,9 @@ async def test_delete_task_push_notification_config_task_not_found():
23642374 )
23652375
23662376 assert isinstance (exc_info .value .error , TaskNotFoundError )
2367- mock_task_store .get .assert_awaited_once_with ('non_existent_task' , context )
2377+ mock_task_store .get .assert_awaited_once_with (
2378+ 'tasks/non_existent_task' , context
2379+ )
23682380 mock_push_store .get_info .assert_not_awaited ()
23692381
23702382
@@ -2422,9 +2434,9 @@ async def test_delete_task_push_notification_config_info_with_config():
24222434 )
24232435
24242436 push_store = InMemoryPushNotificationConfigStore ()
2425- await push_store .set_info ('task_1' , push_config1 )
2426- await push_store .set_info ('task_1' , push_config2 )
2427- await push_store .set_info ('task_2' , push_config1 )
2437+ await push_store .set_info ('tasks/ task_1' , push_config1 )
2438+ await push_store .set_info ('tasks/ task_1' , push_config2 )
2439+ await push_store .set_info ('tasks/ task_2' , push_config1 )
24282440
24292441 request_handler = DefaultRequestHandler (
24302442 agent_executor = MockAgentExecutor (),
@@ -2447,7 +2459,7 @@ async def test_delete_task_push_notification_config_info_with_config():
24472459 )
24482460
24492461 assert len (result2 .configs ) == 1
2450- assert result2 .configs [0 ].task_id == 'task_1'
2462+ assert result2 .configs [0 ].task_id == 'tasks/ task_1'
24512463 assert result2 .configs [0 ].push_notification_config == push_config2
24522464
24532465
@@ -2623,7 +2635,7 @@ async def test_on_subscribe_to_task_in_terminal_state(terminal_state):
26232635 f'Task { task_id } is in terminal state: { terminal_state } '
26242636 in exc_info .value .error .message
26252637 )
2626- mock_task_store .get .assert_awaited_once_with (task_id , context )
2638+ mock_task_store .get .assert_awaited_once_with (f'tasks/ { task_id } ' , context )
26272639
26282640
26292641@pytest .mark .asyncio
0 commit comments