MCPcopy Index your code
hub / github.com/python/cpython / test_chmod_dir_fd

Method test_chmod_dir_fd

Lib/test/test_os/test_posix.py:1680–1686  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1678
1679 @unittest.skipUnless(os.chmod in os.supports_dir_fd, "test needs dir_fd support in os.chmod()")
1680 def test_chmod_dir_fd(self):
1681 with self.prepare_file() as (dir_fd, name, fullname):
1682 posix.chmod(fullname, stat.S_IRUSR)
1683 posix.chmod(name, stat.S_IRUSR | stat.S_IWUSR, dir_fd=dir_fd)
1684 s = posix.stat(fullname)
1685 self.assertEqual(s.st_mode & stat.S_IRWXU,
1686 stat.S_IRUSR | stat.S_IWUSR)
1687
1688 @unittest.skipUnless(hasattr(os, 'chown') and (os.chown in os.supports_dir_fd),
1689 "test needs dir_fd support in os.chown()")

Callers

nothing calls this directly

Calls 4

prepare_fileMethod · 0.95
chmodMethod · 0.45
statMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected