def test_os_lseek(self): fname = str(udir.join('os_test.txt')) fd = os.open(fname, os.O_RDWR|os.O_CREAT, 0777) assert fd >= 0 os.write(fd, 'Hello world') rposix.lseek(fd,0,0) assert os.read(fd, 11) == 'Hello world' os.close(fd) py.test.raises(OSError, rposix.lseek, fd, 0, 0)
def test_os_lseek(self): fname = str(udir.join('os_test.txt')) fd = os.open(fname, os.O_RDWR | os.O_CREAT, 0777) assert fd >= 0 os.write(fd, 'Hello world') rposix.lseek(fd, 0, 0) assert os.read(fd, 11) == 'Hello world' os.close(fd) py.test.raises(OSError, rposix.lseek, fd, 0, 0)