def test_read_longer_buffer(self):
    test_vector = serialized_valid_test_message[:]
    test_vector.append('somegarbageintheend'.encode('hex'))
    serialized = ''.join(test_vector).decode('hex')
    message = test_message_pb2.TestMessage()
    reader = tls_message.TLSReader(serialized)
    reader.read(message)
    self.assertEqual(valid_test_message, message, msg=('%s vs %s' % (valid_test_message, message)))
    self.assertFalse(reader.finished())
def test_read_longer_buffer(self):
    test_vector = serialized_valid_test_message[:]
    test_vector.append('somegarbageintheend'.encode('hex'))
    serialized = .join(test_vector).decode('hex')
    message = test_message_pb2.TestMessage()
    reader = tls_message.TLSReader(serialized)
    reader.read(message)
    self.assertEqual(valid_test_message, message, msg=('%s vs %s' % (valid_test_message, message)))
    self.assertFalse(reader.finished())