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

Method test

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

Source from the content-addressed store, hash-verified

1758 mode <<= 6
1759 with self.subTest(mode=format(mode, '03o')):
1760 def test(target, target_is_directory):
1761 d1 = self.do_create(recurse=0)
1762 symlink = os.path.join(d1.name, 'symlink')
1763 os.symlink(target, symlink,
1764 target_is_directory=target_is_directory)
1765 try:
1766 os.chmod(symlink, mode, follow_symlinks=False)
1767 except NotImplementedError:
1768 pass
1769 try:
1770 os.chmod(symlink, mode)
1771 except FileNotFoundError:
1772 pass
1773 os.chmod(d1.name, mode)
1774 d1.cleanup()
1775 self.assertFalse(os.path.exists(d1.name))
1776
1777 with self.subTest('nonexisting file'):
1778 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