def fstatvfs(space, fd): try: st = rposix_stat.fstatvfs(fd) except OSError as e: raise wrap_oserror(space, e) else: return build_statvfs_result(space, st)
def test_fstatvfs(self): try: os.fstatvfs(0) except OSError as e: py.test.skip("the underlying os.fstatvfs() failed: %s" % e) rposix_stat.fstatvfs(0)
assert stat.st_mode != 0 def test_stat_large_number(self): fname = udir.join('test_stat_large_number.txt') fname.ensure() t1 = 5000000000.0 try: os.utime(str(fname), (t1, t1)) except OverflowError: py.test.skip("This platform doesn't support setting stat times " "to large values") assert rposix_stat.stat(str(fname)).st_mtime == t1 @py.test.mark.skipif(not hasattr(os, 'statvfs'), reason='posix specific function') def test_statvfs(self): try: os.statvfs('.') except OSError, e: py.test.skip("the underlying os.statvfs() failed: %s" % e) rposix_stat.statvfs('.') @py.test.mark.skipif(not hasattr(os, 'fstatvfs'), reason='posix specific function') def test_fstatvfs(self): try: os.fstatvfs(0) except OSError, e: py.test.skip("the underlying os.fstatvfs() failed: %s" % e) rposix_stat.fstatvfs(0)
@py.test.mark.skipif(not hasattr(os, 'statvfs'), reason='posix specific function') def test_statvfs(self): try: os.statvfs('.') except OSError, e: py.test.skip("the underlying os.statvfs() failed: %s" % e) rposix_stat.statvfs('.') @py.test.mark.skipif(not hasattr(os, 'fstatvfs'), reason='posix specific function') def test_fstatvfs(self): try: os.fstatvfs(0) except OSError, e: py.test.skip("the underlying os.fstatvfs() failed: %s" % e) rposix_stat.fstatvfs(0) @py.test.mark.skipif("not hasattr(rposix_stat, 'fstatat')") def test_fstatat(tmpdir): tmpdir.join('file').write('text') dirfd = os.open(str(tmpdir), os.O_RDONLY) try: result = rposix_stat.fstatat('file', dir_fd=dirfd, follow_symlinks=False) finally: os.close(dirfd) assert result.st_atime == tmpdir.join('file').atime()