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

Method test_walk_symlink

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

Source from the content-addressed store, hash-verified

1607 self.sub2_tree)
1608
1609 def test_walk_symlink(self):
1610 if not os_helper.can_symlink():
1611 self.skipTest("need symlink support")
1612
1613 # Walk, following symlinks.
1614 walk_it = self.walk(self.walk_path, follow_symlinks=True)
1615 for root, dirs, files in walk_it:
1616 if root == self.link_path:
1617 self.assertEqual(dirs, [])
1618 self.assertEqual(files, ["tmp4"])
1619 break
1620 else:
1621 self.fail("Didn't follow symlink with followlinks=True")
1622
1623 walk_it = self.walk(self.broken_link_path, follow_symlinks=True)
1624 if self.is_fwalk:
1625 self.assertRaises(FileNotFoundError, next, walk_it)
1626 self.assertRaises(StopIteration, next, walk_it)
1627
1628 def test_walk_bad_dir(self):
1629 # 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