def test_checksum_read(bs, typ, value): assert checksum_rw.read(BytesIO(bytearray(bs))) == (typ, value)
def test_chucksum_round_trip(typ, value): buff = checksum_rw.write((typ, value), BytesIO()).getvalue() assert (typ, value) == checksum_rw.read(BytesIO(buff))