def test_tracing_round_trip(): for i in xrange(100): t = Tracing( random.randint(0, 100000), random.randint(0, 100000), random.randint(0, 100000), random.randint(0, 1) ) buff = tracing_rw.write(t, BytesIO()).getvalue() assert t == tracing_rw.read(BytesIO(buff))
def test_tracing_round_trip(): for i in range(100): t = Tracing( random.randint(0, 100000), random.randint(0, 100000), random.randint(0, 100000), random.randint(0, 1), ) buff = tracing_rw.write(t, BytesIO()).getvalue() assert t == tracing_rw.read(BytesIO(buff))
def test_tracing_read(tracing, bs): assert tracing_rw.read(BytesIO(bytearray(bs))) == tracing