File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1022,9 +1022,9 @@ def to_compat_task_push_notification_config(
10221022 """Convert task push notification config to v0.3 compat type."""
10231023 return types_v03 .TaskPushNotificationConfig (
10241024 task_id = core_config .task_id ,
1025- push_notification_config = to_compat_push_notification_config (core_config )
1026- if core_config . url
1027- else types_v03 . PushNotificationConfig ( url = '' ),
1025+ push_notification_config = to_compat_push_notification_config (
1026+ core_config
1027+ ),
10281028 )
10291029
10301030
@@ -1202,9 +1202,7 @@ def to_compat_create_task_push_notification_config_request(
12021202 task_id = core_req .task_id ,
12031203 push_notification_config = to_compat_push_notification_config (
12041204 core_req
1205- )
1206- if core_req .url
1207- else types_v03 .PushNotificationConfig (url = '' ),
1205+ ),
12081206 ),
12091207 )
12101208
Original file line number Diff line number Diff line change @@ -418,18 +418,16 @@ def test_set_push_notification_config(
418418 'method' : 'CreateTaskPushNotificationConfig' ,
419419 'params' : {
420420 'task_id' : 't2' ,
421- 'config' : {
422- 'url' : 'https://example.com' ,
423- 'token' : 'secret-token' ,
424- },
421+ 'url' : 'https://example.com' ,
422+ 'token' : 'secret-token' ,
425423 },
426424 },
427425 )
428426
429427 # Verify response
430428 assert response .status_code == 200
431429 data = response .json ()
432- assert data ['result' ]['pushNotificationConfig' ][ ' token' ] == 'secret-token'
430+ assert data ['result' ]['token' ] == 'secret-token'
433431
434432 # Verify handler was called
435433 handler .on_create_task_push_notification_config .assert_awaited_once ()
@@ -463,7 +461,7 @@ def test_get_push_notification_config(
463461 # Verify response
464462 assert response .status_code == 200
465463 data = response .json ()
466- assert data ['result' ]['pushNotificationConfig' ][ ' token' ] == 'secret-token'
464+ assert data ['result' ]['token' ] == 'secret-token'
467465
468466 # Verify handler was called
469467 handler .on_get_task_push_notification_config .assert_awaited_once ()
You can’t perform that action at this time.
0 commit comments