MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_unlink_dir_fd

Method test_unlink_dir_fd

Lib/test/test_posix.py:1777–1786  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1775
1776 @unittest.skipUnless(os.unlink in os.supports_dir_fd, "test needs dir_fd support in os.unlink()")
1777 def test_unlink_dir_fd(self):
1778 with self.prepare() as (dir_fd, name, fullname):
1779 os_helper.create_empty_file(fullname)
1780 posix.stat(fullname) # should not raise exception
1781 try:
1782 posix.unlink(name, dir_fd=dir_fd)
1783 self.assertRaises(OSError, posix.stat, fullname)
1784 except:
1785 self.addCleanup(posix.unlink, fullname)
1786 raise
1787
1788 @unittest.skipUnless(hasattr(os, 'mkfifo') and os.mkfifo in os.supports_dir_fd, "test needs dir_fd support in os.mkfifo()")
1789 def test_mkfifo_dir_fd(self):

Callers

nothing calls this directly

Calls 5

prepareMethod · 0.95
addCleanupMethod · 0.80
statMethod · 0.45
unlinkMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected