

@defer.inlineCallbacks
def test_delivery_HttpConnector(self):
    (yield self.connect('127.0.0.1', self.pbPort))
    source_connector = Connector(id_generator())
    (yield self.prepareRoutingsAndStartConnector(source_connector))
    pdu = DeliverSM(source_addr='1234', destination_addr='4567', short_message='any content')
    (yield self.triggerDeliverSmFromSMSC([pdu]))
    self.assertEquals(self.pbRoot_f.deliver_sm_callback.call_count, 1)
    self.assertEqual(self.AckServerResource.render_GET.call_count, 1)
    receivedHttpReq = self.AckServerResource.last_request.args
    self.assertEqual(len(receivedHttpReq), 8)
    self.assertEqual(receivedHttpReq['from'], [pdu.params['source_addr']])
    self.assertEqual(receivedHttpReq['to'], [pdu.params['destination_addr']])
    self.assertEqual(receivedHttpReq['content'], [pdu.params['short_message']])
    self.assertEqual(receivedHttpReq['binary'], [binascii.hexlify(pdu.params['short_message'])])
    self.assertEqual(receivedHttpReq['origin-connector'], [source_connector.cid])
    (yield self.stopConnector(source_connector))

dataset/ETHPy150Open jookies/jasmin/jasmin/routing/test/test_routing_deliver_sm.py DeliverSmHttpThrowingTestCases.test_delivery_HttpConnector/original