@@ -302,10 +302,12 @@ async def test_set_task_callback_with_valid_task(
302302 sample_task_push_notification_config : TaskPushNotificationConfig ,
303303):
304304 """Test setting a task push notification config with a valid task id."""
305+ task_id = 'task-1'
306+ config_id = 'config-1'
305307 mock_grpc_stub .CreateTaskPushNotificationConfig .return_value = (
306308 a2a_pb2 .CreateTaskPushNotificationConfigRequest (
307- parent = 'tasks/task-1 ' ,
308- config_id = 'config-1' ,
309+ parent = f 'tasks/{ task_id } ' ,
310+ config_id = config_id ,
309311 config = proto_utils .ToProto .task_push_notification_config (
310312 sample_task_push_notification_config
311313 ),
@@ -323,7 +325,7 @@ async def test_set_task_callback_with_valid_task(
323325 ),
324326 )
325327 )
326- assert response .taskId == 'task-1'
328+ assert response .taskId == task_id
327329
328330
329331@pytest .mark .asyncio
@@ -333,10 +335,12 @@ async def test_set_task_callback_with_invalid_task(
333335 sample_task_push_notification_config : TaskPushNotificationConfig ,
334336):
335337 """Test setting a task push notification config with a invalid task id."""
338+ task_id = 'task-1'
339+ config_id = 'config-1'
336340 mock_grpc_stub .CreateTaskPushNotificationConfig .return_value = (
337341 a2a_pb2 .CreateTaskPushNotificationConfigRequest (
338- parent = 'invalid-path-to-tasks/task-1 ' ,
339- config_id = 'config-1' ,
342+ parent = f 'invalid-path-to-tasks/{ task_id } ' ,
343+ config_id = config_id ,
340344 config = proto_utils .ToProto .task_push_notification_config (
341345 sample_task_push_notification_config
342346 ),
@@ -357,10 +361,12 @@ async def test_get_task_callback_with_valid_task(
357361 sample_task_push_notification_config : TaskPushNotificationConfig ,
358362):
359363 """Test retrieving a task push notification config with a valid task id."""
364+ task_id = 'task-1'
365+ config_id = 'config-1'
360366 mock_grpc_stub .GetTaskPushNotificationConfig .return_value = (
361367 a2a_pb2 .CreateTaskPushNotificationConfigRequest (
362- parent = 'tasks/task-1 ' ,
363- config_id = 'config-1' ,
368+ parent = f 'tasks/{ task_id } ' ,
369+ config_id = config_id ,
364370 config = proto_utils .ToProto .task_push_notification_config (
365371 sample_task_push_notification_config
366372 ),
@@ -375,7 +381,7 @@ async def test_get_task_callback_with_valid_task(
375381 name = f'tasks/{ params .id } /pushNotification/undefined' ,
376382 )
377383 )
378- assert response .taskId == 'task-1'
384+ assert response .taskId == task_id
379385
380386
381387@pytest .mark .asyncio
@@ -385,10 +391,12 @@ async def test_get_task_callback_with_invalid_task(
385391 sample_task_push_notification_config : TaskPushNotificationConfig ,
386392):
387393 """Test retrieving a task push notification config with a invalid task id."""
394+ task_id = 'task-1'
395+ config_id = 'config-1'
388396 mock_grpc_stub .GetTaskPushNotificationConfig .return_value = (
389397 a2a_pb2 .CreateTaskPushNotificationConfigRequest (
390- parent = 'invalid-path-to-tasks/task-1 ' ,
391- config_id = 'config-1' ,
398+ parent = f 'invalid-path-to-tasks/{ task_id } ' ,
399+ config_id = config_id ,
392400 config = proto_utils .ToProto .task_push_notification_config (
393401 sample_task_push_notification_config
394402 ),
0 commit comments