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

Method test_rename_replace

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

Source from the content-addressed store, hash-verified

2491 os.mknod("path", dir_fd=0)
2492
2493 def test_rename_replace(self):
2494 self._verify_available("HAVE_RENAMEAT")
2495 if self.mac_ver >= (10, 10):
2496 self.assertIn("HAVE_RENAMEAT", posix._have_functions)
2497
2498 else:
2499 self.assertNotIn("HAVE_RENAMEAT", posix._have_functions)
2500
2501 with self.assertRaisesRegex(NotImplementedError, "src_dir_fd and dst_dir_fd unavailable"):
2502 os.rename("a", "b", src_dir_fd=0)
2503
2504 with self.assertRaisesRegex(NotImplementedError, "src_dir_fd and dst_dir_fd unavailable"):
2505 os.rename("a", "b", dst_dir_fd=0)
2506
2507 with self.assertRaisesRegex(NotImplementedError, "src_dir_fd and dst_dir_fd unavailable"):
2508 os.replace("a", "b", src_dir_fd=0)
2509
2510 with self.assertRaisesRegex(NotImplementedError, "src_dir_fd and dst_dir_fd unavailable"):
2511 os.replace("a", "b", dst_dir_fd=0)
2512
2513 def test_unlink_rmdir(self):
2514 self._verify_available("HAVE_UNLINKAT")

Callers

nothing calls this directly

Calls 6

_verify_availableMethod · 0.95
assertInMethod · 0.80
assertNotInMethod · 0.80
assertRaisesRegexMethod · 0.80
renameMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected