(self, walk_path=None)
| 1769 | self.assertEqual(all[3 - 2 * flipped], self.sub2_tree) |
| 1770 | |
| 1771 | def test_walk_prune(self, walk_path=None): |
| 1772 | if walk_path is None: |
| 1773 | walk_path = self.walk_path |
| 1774 | # Prune the search. |
| 1775 | all = [] |
| 1776 | for root, dirs, files in self.walk(walk_path): |
| 1777 | all.append((root, dirs, files)) |
| 1778 | # Don't descend into SUB1. |
| 1779 | if 'SUB1' in dirs: |
| 1780 | # Note that this also mutates the dirs we appended to all! |
| 1781 | dirs.remove('SUB1') |
| 1782 | |
| 1783 | self.assertEqual(len(all), 2) |
| 1784 | self.assertEqual(all[0], (self.walk_path, ["SUB2"], ["tmp1"])) |
| 1785 | |
| 1786 | all[1][-1].sort() |
| 1787 | all[1][1].sort() |
| 1788 | self.assertEqual(all[1], self.sub2_tree) |
| 1789 | |
| 1790 | def test_file_like_path(self): |
| 1791 | self.test_walk_prune(FakePath(self.walk_path)) |
no test coverage detected