MCPcopy Create free account
hub / github.com/python/cpython / test_chmod

Method test_chmod

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

Source from the content-addressed store, hash-verified

2381 os.access("file", os.R_OK, effective_ids=True)
2382
2383 def test_chmod(self):
2384 self._verify_available("HAVE_FCHMODAT")
2385 if self.mac_ver >= (10, 10):
2386 self.assertIn("HAVE_FCHMODAT", posix._have_functions)
2387
2388 else:
2389 self.assertNotIn("HAVE_FCHMODAT", posix._have_functions)
2390 self.assertIn("HAVE_LCHMOD", posix._have_functions)
2391
2392 with self.assertRaisesRegex(NotImplementedError, "dir_fd unavailable"):
2393 os.chmod("file", 0o644, dir_fd=0)
2394
2395 def test_chown(self):
2396 self._verify_available("HAVE_FCHOWNAT")

Callers

nothing calls this directly

Calls 5

_verify_availableMethod · 0.95
assertInMethod · 0.80
assertNotInMethod · 0.80
assertRaisesRegexMethod · 0.80
chmodMethod · 0.45

Tested by

no test coverage detected