def _perform_soap_request(self, response, *a, **kw): """ Perform a SOAP request with a canned response. """ return perform_soap_request( http_request_full=partial( self._http_request_full, response), *a, **kw)
def _perform_soap_request(self, response, *a, **kw): """ Perform a SOAP request with a canned response. """ return perform_soap_request(http_request_full=partial( self._http_request_full, response), *a, **kw)
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_receive_sms(self): """ When a text message is submitted to the Vumi ParlayX ``notifySmsReception`` SOAP endpoint, a message is published containing the message identifier, message content, from address and to address that accurately match what was submitted. """ yield self.transport.startWorker() body = create_sms_reception_element('1234', 'message', '+27117654321', '54321') yield perform_soap_request(self.uri, '', body) [msg] = self.tx_helper.get_dispatched_inbound() self.assertEqual(('1234', 'message', '+27117654321', '54321'), (msg['message_id'], msg['content'], msg['from_addr'], msg['to_addr']))
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_receive_sms(self): """ When a text message is submitted to the Vumi ParlayX ``notifySmsReception`` SOAP endpoint, a message is published containing the message identifier, message content, from address and to address that accurately match what was submitted. """ yield self.transport.startWorker() body = create_sms_reception_element( '1234', 'message', '+27117654321', '54321') yield perform_soap_request(self.uri, '', body) [msg] = self.tx_helper.get_dispatched_inbound() self.assertEqual( ('1234', 'message', '+27117654321', '54321'), (msg['message_id'], msg['content'], msg['from_addr'], msg['to_addr']))