

@defer.inlineCallbacks
def test_long_content_delivery_UDH_HttpConnector(self):
    (yield self.connect('127.0.0.1', self.pbPort))
    source_connector = Connector(id_generator())
    (yield self.prepareRoutingsAndStartConnector(source_connector))
    baseUdh = []
    baseUdh.append(struct.pack('!B', 5))
    baseUdh.append(struct.pack('!B', 0))
    baseUdh.append(struct.pack('!B', 3))
    baseUdh.append(struct.pack('!B', int(id_generator(size=2, chars=string.digits))))
    baseUdh.append(struct.pack('!B', 3))
    basePdu = DeliverSM(source_addr='1234', destination_addr='4567', short_message='', esm_class=EsmClass(EsmClassMode.DEFAULT, EsmClassType.DEFAULT, [EsmClassGsmFeatures.UDHI_INDICATOR_SET]))
    pdu_part1 = copy.deepcopy(basePdu)
    udh_part1 = copy.deepcopy(baseUdh)
    pdu_part2 = copy.deepcopy(basePdu)
    udh_part2 = copy.deepcopy(baseUdh)
    pdu_part3 = copy.deepcopy(basePdu)
    udh_part3 = copy.deepcopy(baseUdh)
    udh_part1.append(struct.pack('!B', 1))
    pdu_part1.params['more_messages_to_send'] = MoreMessagesToSend.MORE_MESSAGES
    pdu_part1.params['short_message'] = (''.join(udh_part1) + '__1st_part_with_153_char________________________________________________________________________________________________________________________________.')
    udh_part2.append(struct.pack('!B', 2))
    pdu_part2.params['more_messages_to_send'] = MoreMessagesToSend.MORE_MESSAGES
    pdu_part2.params['short_message'] = (''.join(udh_part2) + '__2nd_part_with_153_char________________________________________________________________________________________________________________________________.')
    udh_part3.append(struct.pack('!B', 3))
    pdu_part3.params['more_messages_to_send'] = MoreMessagesToSend.NO_MORE_MESSAGES
    pdu_part3.params['short_message'] = (''.join(udh_part3) + '__3rd_part_end.')
    (yield self.triggerDeliverSmFromSMSC([pdu_part1, pdu_part2, pdu_part3]))
    self.assertEqual(self.AckServerResource.render_GET.call_count, 1)
    receivedHttpReq = self.AckServerResource.last_request.args
    self.assertEqual(len(receivedHttpReq), 8)
    self.assertEqual(receivedHttpReq['from'], [basePdu.params['source_addr']])
    self.assertEqual(receivedHttpReq['to'], [basePdu.params['destination_addr']])
    self.assertEqual(receivedHttpReq['content'], [((pdu_part1.params['short_message'][6:] + pdu_part2.params['short_message'][6:]) + pdu_part3.params['short_message'][6:])])
    self.assertEqual(receivedHttpReq['binary'], [binascii.hexlify(((pdu_part1.params['short_message'][6:] + pdu_part2.params['short_message'][6:]) + pdu_part3.params['short_message'][6:]))])
    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_long_content_delivery_UDH_HttpConnector/original