Beispiel #1
0
 def test_decode_value_delimited(self):
     value = Decoder.decode_delimited(binascii.unhexlify('02'+'ac02'), Types().as_type('int32'))
     self.assertEquals(300, value)
Beispiel #2
0
 def _receive_response(self):
     """ Receive data from the server and decode it into a KRPC.Response object """
     # FIXME: we might not receive all of the data in one go
     data = self._connection.recv(BUFFER_SIZE)
     return _Decoder.decode_delimited(data, self._response_type)
Beispiel #3
0
 def test_decode_message_delimited(self):
     typ = krpc.schema.KRPC.Request
     message = '1c'+'0a0b536572766963654e616d65120d50726f6365647572654e616d65'
     request = Decoder.decode_delimited(binascii.unhexlify(message), Types().as_type('KRPC.Request'))
     self.assertEquals('ServiceName', request.service)
     self.assertEquals('ProcedureName', request.procedure)