def test_delivery_receipt(self): """ When a delivery receipt is submitted to the Vumi ParlayX ``notifySmsDeliveryReceiptResponse`` SOAP endpoint, an event is published containing the message identifier and the delivery status that accurately match what was submitted. """ yield self.transport.startWorker() body = create_sms_delivery_receipt('1234', '+27117654321', DeliveryStatus.DeliveredToNetwork) yield perform_soap_request(self.uri, '', body) [event] = self.tx_helper.get_dispatched_events() self.assertEqual(('1234', 'delivered'), (event['user_message_id'], event['delivery_status']))
def test_delivery_receipt(self): """ When a delivery receipt is submitted to the Vumi ParlayX ``notifySmsDeliveryReceiptResponse`` SOAP endpoint, an event is published containing the message identifier and the delivery status that accurately match what was submitted. """ yield self.transport.startWorker() body = create_sms_delivery_receipt( '1234', '+27117654321', DeliveryStatus.DeliveredToNetwork) yield perform_soap_request(self.uri, '', body) [event] = self.tx_helper.get_dispatched_events() self.assertEqual( ('1234', 'delivered'), (event['user_message_id'], event['delivery_status']))
def test_process_notifySmsDeliveryReceipt(self): """ `SmsNotificationService.process_notifySmsDeliveryReceipt` invokes the delivery receipt callback with the correlator (message identifier) and the delivery status (translated into a Vumi-compatible value.) """ def callback(*a): self.callbacks.append(a) self.callbacks = [] service = SmsNotificationService(None, callback) self.successResultOf(service.process(None, SOAP_ENV.Body( create_sms_delivery_receipt( '1234', '+27117654321', DeliveryStatus.DeliveryUncertain)))) self.assertEqual(1, len(self.callbacks)) correlator, status = self.callbacks[0] self.assertEqual(('1234', 'pending'), self.callbacks[0])
def test_process_notifySmsDeliveryReceipt(self): """ `SmsNotificationService.process_notifySmsDeliveryReceipt` invokes the delivery receipt callback with the correlator (message identifier) and the delivery status (translated into a Vumi-compatible value.) """ def callback(*a): self.callbacks.append(a) self.callbacks = [] service = SmsNotificationService(None, callback) self.successResultOf( service.process( None, SOAP_ENV.Body( create_sms_delivery_receipt( '1234', '+27117654321', DeliveryStatus.DeliveryUncertain)))) self.assertEqual(1, len(self.callbacks)) correlator, status = self.callbacks[0] self.assertEqual(('1234', 'pending'), self.callbacks[0])