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

Method test

Lib/test/test_tempfile.py:1742–1757  ·  view source on GitHub ↗
(target, target_is_directory)

Source from the content-addressed store, hash-verified

1740 mode <<= 6
1741 with self.subTest(mode=format(mode, '03o')):
1742 def test(target, target_is_directory):
1743 d1 = self.do_create(recurse=0)
1744 symlink = os.path.join(d1.name, 'symlink')
1745 os.symlink(target, symlink,
1746 target_is_directory=target_is_directory)
1747 try:
1748 os.chmod(symlink, mode, follow_symlinks=False)
1749 except NotImplementedError:
1750 pass
1751 try:
1752 os.chmod(symlink, mode)
1753 except FileNotFoundError:
1754 pass
1755 os.chmod(d1.name, mode)
1756 d1.cleanup()
1757 self.assertFalse(os.path.exists(d1.name))
1758
1759 with self.subTest('nonexisting file'):
1760 test('nonexisting', target_is_directory=False)

Callers

nothing calls this directly

Calls 6

do_createMethod · 0.95
assertFalseMethod · 0.80
joinMethod · 0.45
chmodMethod · 0.45
cleanupMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected