

def test_encode_latin1_long(self):
    '\n        Test that a latin1 short message long text gets successfully sliced into\n        multiple PDUs (parts)\n        '
    sm = binascii.a2b_hex(self.latin1_long_sm)
    pdu = self.buildSubmitSmTest(sm)
    self.assertTrue(isinstance(assembledSm.nextPdu, SubmitSM))
    self.assertTrue((pdu.params['sar_msg_ref_num'] > 0))
    self.assertTrue((pdu.params['sar_total_segments'] > 0))
    self.assertTrue((pdu.params['sar_segment_seqnum'] > 0))
    partedSmPdu = pdu
    assembledSm = ''
    lastSeqNum = 0
    while True:
        assembledSm += partedSmPdu.params['short_message']
        self.assertTrue((partedSmPdu.params['sar_msg_ref_num'] == pdu.params['sar_msg_ref_num']))
        self.assertTrue((partedSmPdu.params['sar_total_segments'] == pdu.params['sar_total_segments']))
        self.assertTrue((partedSmPdu.params['sar_segment_seqnum'] > lastSeqNum))
        lastSeqNum = partedSmPdu.params['sar_segment_seqnum']
        try:
            partedSmPdu = partedSmPdu.nextPdu
        except AttributeError:
            break
    self.assertEquals(assembledSm, sm)
    self.assertEquals(lastSeqNum, pdu.params['sar_total_segments'])

dataset/ETHPy150Open jookies/jasmin/jasmin/protocols/smpp/test/test_operations.py SubmitTest.test_encode_latin1_long/VarMisuse@38/94 `pdu`->`assembledSm`