(self)
| 87 | self.assertNotIn(self.realpath, filelist) |
| 88 | |
| 89 | def test_recurse(self): |
| 90 | ff = grep.findfiles |
| 91 | parent = os.path.dirname(self.path) |
| 92 | grepfile = os.path.join(parent, 'grep.py') |
| 93 | pat = '*.py' |
| 94 | |
| 95 | # Get Python files only in parent directory. |
| 96 | filelist = list(ff(parent, pat, False)) |
| 97 | parent_size = len(filelist) |
| 98 | # Lots of Python files in idlelib. |
| 99 | self.assertGreater(parent_size, 20) |
| 100 | self.assertIn(grepfile, filelist) |
| 101 | # Without subdirectories, this file isn't returned. |
| 102 | self.assertNotIn(self.realpath, filelist) |
| 103 | |
| 104 | # Include subdirectories. |
| 105 | filelist = list(ff(parent, pat, True)) |
| 106 | # More files found now. |
| 107 | self.assertGreater(len(filelist), parent_size) |
| 108 | self.assertIn(grepfile, filelist) |
| 109 | # This file exists in list now. |
| 110 | self.assertIn(self.realpath, filelist) |
| 111 | |
| 112 | # Check another level up the tree. |
| 113 | parent = os.path.dirname(parent) |
| 114 | filelist = list(ff(parent, '*.py', True)) |
| 115 | self.assertIn(self.realpath, filelist) |
| 116 | |
| 117 | |
| 118 | class Grep_itTest(unittest.TestCase): |
nothing calls this directly
no test coverage detected