Exemplo n.º 1
0
def test_01_bind_rcr_rsp_encode():
    "Test Bind Receiver Response encoding"
    P = BindReceiverResp()

    P.system_id = CString("SMPP3TEST")
    P.interface_version = Integer(IV.SMPP_VERSION_5, 1)
    
    assert '00 00 00 1B 80 00 00 01 00 00 00 00 00 00 00 01 53 4D 50 50 33 54 45 53 54 00 50 ' == hex_convert(P.encode(), 150)
Exemplo n.º 2
0
def test_02_bind_rcr_rsp_decode():
    "Test Bind Receiver Response decoding"
    data = b'\x00\x00\x00\x1B\x80\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01SMPP3TEST\x00\x50'
    P = BindReceiverResp.decode(data)
    assert '00 00 00 1B 80 00 00 01 00 00 00 00 00 00 00 01 53 4D 50 50 33 54 45 53 54 00 50 ' == hex_convert(P.encode(), 150)