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

Method test_link_dir_fd

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

Source from the content-addressed store, hash-verified

1773 "test needs dir_fd support in os.link()"
1774 )
1775 def test_link_dir_fd(self):
1776 with self.prepare_file() as (dir_fd, name, fullname), \
1777 self.prepare() as (dir_fd2, linkname, fulllinkname):
1778 try:
1779 posix.link(name, linkname, src_dir_fd=dir_fd, dst_dir_fd=dir_fd2)
1780 except PermissionError as e:
1781 self.skipTest('posix.link(): %s' % e)
1782 self.addCleanup(posix.unlink, fulllinkname)
1783 # should have same inodes
1784 self.assertEqual(posix.stat(fullname)[1],
1785 posix.stat(fulllinkname)[1])
1786
1787 @unittest.skipUnless(os.mkdir in os.supports_dir_fd, "test needs dir_fd support in os.mkdir()")
1788 def test_mkdir_dir_fd(self):

Callers

nothing calls this directly

Calls 6

prepare_fileMethod · 0.95
prepareMethod · 0.95
skipTestMethod · 0.80
addCleanupMethod · 0.80
assertEqualMethod · 0.45
statMethod · 0.45

Tested by

no test coverage detected