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

Method test_walk_symlink

Lib/test/test_os/test_os.py:1814–1831  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1812 self.sub2_tree)
1813
1814 def test_walk_symlink(self):
1815 if not os_helper.can_symlink():
1816 self.skipTest("need symlink support")
1817
1818 # Walk, following symlinks.
1819 walk_it = self.walk(self.walk_path, follow_symlinks=True)
1820 for root, dirs, files in walk_it:
1821 if root == self.link_path:
1822 self.assertEqual(dirs, [])
1823 self.assertEqual(files, ["tmp4"])
1824 break
1825 else:
1826 self.fail("Didn't follow symlink with followlinks=True")
1827
1828 walk_it = self.walk(self.broken_link_path, follow_symlinks=True)
1829 if self.is_fwalk:
1830 self.assertRaises(FileNotFoundError, next, walk_it)
1831 self.assertRaises(StopIteration, next, walk_it)
1832
1833 def test_walk_bad_dir(self):
1834 # Walk top-down.

Callers

nothing calls this directly

Calls 5

walkMethod · 0.95
skipTestMethod · 0.80
assertEqualMethod · 0.45
failMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected