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

Method test_access

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

Source from the content-addressed store, hash-verified

2364 self.assertNotIn("HAVE_PTSNAME_R", posix._have_functions)
2365
2366 def test_access(self):
2367 self._verify_available("HAVE_FACCESSAT")
2368 if self.mac_ver >= (10, 10):
2369 self.assertIn("HAVE_FACCESSAT", posix._have_functions)
2370
2371 else:
2372 self.assertNotIn("HAVE_FACCESSAT", posix._have_functions)
2373
2374 with self.assertRaisesRegex(NotImplementedError, "dir_fd unavailable"):
2375 os.access("file", os.R_OK, dir_fd=0)
2376
2377 with self.assertRaisesRegex(NotImplementedError, "follow_symlinks unavailable"):
2378 os.access("file", os.R_OK, follow_symlinks=False)
2379
2380 with self.assertRaisesRegex(NotImplementedError, "effective_ids unavailable"):
2381 os.access("file", os.R_OK, effective_ids=True)
2382
2383 def test_chmod(self):
2384 self._verify_available("HAVE_FCHMODAT")

Callers

nothing calls this directly

Calls 5

_verify_availableMethod · 0.95
assertInMethod · 0.80
assertNotInMethod · 0.80
assertRaisesRegexMethod · 0.80
accessMethod · 0.80

Tested by

no test coverage detected