def test_01_outbind_encode(): "Test Out Bind encoding" P = OutBind() P.system_id = CString("SMPP3TEST") P.password = CString("secret08") assert '00 00 00 23 00 00 00 0B 00 00 00 00 00 00 00 01 53 4D 50 50 33 54 45 53 54 00 73 65 63 72 65 74 30 38 00 ' == hex_convert(P.encode(), 150)
def test_02_outbind_decode(): "Test Out Bind decoding" data = b'\x00\x00\x00\x23\x00\x00\x00\x0B\x00\x00\x00\x00\x00\x00\x00\x01SMPP3TEST\x00secret08\x00' P = OutBind.decode(data) assert '00 00 00 23 00 00 00 0B 00 00 00 00 00 00 00 01 53 4D 50 50 33 54 45 53 54 00 73 65 63 72 65 74' + \ ' 30 38 00 ' == hex_convert(P.encode(), 150)