1111)
1212from tests .e2e .helpers import store_webhook_response
1313
14- SINCH_SMS_CALLBACK_SECRET = 'KayakingTheSwell'
14+ SINCH_SMS_SINCH_EVENT_SECRET = 'KayakingTheSwell'
1515
1616
17- @given ('the SMS Webhooks handler is available' )
17+ @given ('the SMS Sinch Events handler is available' )
1818def step_webhook_handler_is_available (context ):
19- context .sms_webhook = SmsSinchEvent (SINCH_SMS_CALLBACK_SECRET )
19+ context .sms_sinch_event = SmsSinchEvent (SINCH_SMS_SINCH_EVENT_SECRET )
2020
2121
2222@when ('I send a request to trigger an "incoming SMS" event' )
2323def step_send_incoming_sms_event (context ):
2424 response = requests .get ('http://localhost:3017/webhooks/sms/incoming-sms' )
2525 store_webhook_response (context , response )
26- context .event = context .sms_webhook .parse_event (context .raw_event )
26+ context .event = context .sms_sinch_event .parse_event (context .raw_event )
2727
2828
2929@then ('the header of the event "{event_type}" contains a valid signature' )
3030@then ('the header of the event "{event_type}" with the status "{status}" contains a valid signature' )
3131def step_check_valid_signature (context , event_type , status = None ):
32- assert context .sms_webhook .validate_authentication_header (
32+ assert context .sms_sinch_event .validate_authentication_header (
3333 context .webhook_headers , context .raw_event
3434 ), 'Signature validation failed'
3535
@@ -51,7 +51,7 @@ def step_check_incoming_sms_event(context):
5151def step_send_delivery_report_event (context ):
5252 response = requests .get ('http://localhost:3017/webhooks/sms/delivery-report-sms' )
5353 store_webhook_response (context , response )
54- context .event = context .sms_webhook .parse_event (context .raw_event )
54+ context .event = context .sms_sinch_event .parse_event (context .raw_event )
5555
5656
5757@then ('the SMS event describes an "SMS delivery report" event' )
@@ -79,7 +79,7 @@ def step_send_recipient_delivery_report_event_delivered(context):
7979 'http://localhost:3017/webhooks/sms/recipient-delivery-report-sms-delivered'
8080 )
8181 store_webhook_response (context , response )
82- context .event = context .sms_webhook .parse_event (context .raw_event )
82+ context .event = context .sms_sinch_event .parse_event (context .raw_event )
8383
8484
8585@when ('I send a request to trigger an "SMS recipient delivery report" event with the status "Aborted"' )
@@ -88,7 +88,7 @@ def step_send_recipient_delivery_report_event_aborted(context):
8888 'http://localhost:3017/webhooks/sms/recipient-delivery-report-sms-aborted'
8989 )
9090 store_webhook_response (context , response )
91- context .event = context .sms_webhook .parse_event (context .raw_event )
91+ context .event = context .sms_sinch_event .parse_event (context .raw_event )
9292
9393
9494@then ('the SMS event describes an SMS recipient delivery report event with the status "Delivered"' )
0 commit comments