@@ -302,10 +302,12 @@ async def test_set_task_callback_with_valid_task(
302
302
sample_task_push_notification_config : TaskPushNotificationConfig ,
303
303
):
304
304
"""Test setting a task push notification config with a valid task id."""
305
+ task_id = 'task-1'
306
+ config_id = 'config-1'
305
307
mock_grpc_stub .CreateTaskPushNotificationConfig .return_value = (
306
308
a2a_pb2 .CreateTaskPushNotificationConfigRequest (
307
- parent = 'tasks/task-1 ' ,
308
- config_id = 'config-1' ,
309
+ parent = f 'tasks/{ task_id } ' ,
310
+ config_id = config_id ,
309
311
config = proto_utils .ToProto .task_push_notification_config (
310
312
sample_task_push_notification_config
311
313
),
@@ -323,7 +325,7 @@ async def test_set_task_callback_with_valid_task(
323
325
),
324
326
)
325
327
)
326
- assert response .taskId == 'task-1'
328
+ assert response .taskId == task_id
327
329
328
330
329
331
@pytest .mark .asyncio
@@ -333,10 +335,12 @@ async def test_set_task_callback_with_invalid_task(
333
335
sample_task_push_notification_config : TaskPushNotificationConfig ,
334
336
):
335
337
"""Test setting a task push notification config with a invalid task id."""
338
+ task_id = 'task-1'
339
+ config_id = 'config-1'
336
340
mock_grpc_stub .CreateTaskPushNotificationConfig .return_value = (
337
341
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 ,
340
344
config = proto_utils .ToProto .task_push_notification_config (
341
345
sample_task_push_notification_config
342
346
),
@@ -357,10 +361,12 @@ async def test_get_task_callback_with_valid_task(
357
361
sample_task_push_notification_config : TaskPushNotificationConfig ,
358
362
):
359
363
"""Test retrieving a task push notification config with a valid task id."""
364
+ task_id = 'task-1'
365
+ config_id = 'config-1'
360
366
mock_grpc_stub .GetTaskPushNotificationConfig .return_value = (
361
367
a2a_pb2 .CreateTaskPushNotificationConfigRequest (
362
- parent = 'tasks/task-1 ' ,
363
- config_id = 'config-1' ,
368
+ parent = f 'tasks/{ task_id } ' ,
369
+ config_id = config_id ,
364
370
config = proto_utils .ToProto .task_push_notification_config (
365
371
sample_task_push_notification_config
366
372
),
@@ -375,7 +381,7 @@ async def test_get_task_callback_with_valid_task(
375
381
name = f'tasks/{ params .id } /pushNotification/undefined' ,
376
382
)
377
383
)
378
- assert response .taskId == 'task-1'
384
+ assert response .taskId == task_id
379
385
380
386
381
387
@pytest .mark .asyncio
@@ -385,10 +391,12 @@ async def test_get_task_callback_with_invalid_task(
385
391
sample_task_push_notification_config : TaskPushNotificationConfig ,
386
392
):
387
393
"""Test retrieving a task push notification config with a invalid task id."""
394
+ task_id = 'task-1'
395
+ config_id = 'config-1'
388
396
mock_grpc_stub .GetTaskPushNotificationConfig .return_value = (
389
397
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 ,
392
400
config = proto_utils .ToProto .task_push_notification_config (
393
401
sample_task_push_notification_config
394
402
),
0 commit comments