'Assert that encoding C{record} and then decoding the resulting bytes
creates a record which compares equal to C{record}.'

def _recordRoundtripTest(self, record):

    stream = BytesIO()
    record.encode(stream)
    length = stream.tell()
    stream.seek(0, 0)
    replica = record.__class__()
    replica.decode(stream, length)
    self.assertEqual(record, replica)
