def test_SparseFile_seek_whence_2(size): from oniontree.sparsefile import SparseFile sf = SparseFile(size=size) for i in range(0, -(size + 1), -1): sf.seek(i, 2) assert len(sf.read()) == abs(i)
def test_SparseFile_seek(size): from oniontree.sparsefile import SparseFile sf = SparseFile(size=size) for i in range(0, size): sf.seek(i) assert len(sf.read()) == size - i