def test_length(): lengths = np.random.randint(0, 15000, size=100) o = encoding.Numpy8(np.zeros(900, dtype=np.uint8)) for l in lengths: o.loc = 0 writer.write_length(l, o) o.loc = 0 out = encoding.read_length(o) assert l == out