(self)
| 65 | os.chdir(save_cwd) |
| 66 | |
| 67 | def test_base(self): |
| 68 | ff = grep.findfiles |
| 69 | readme = os.path.join(self.path, 'README.txt') |
| 70 | |
| 71 | # Check for Python files in path where this file lives. |
| 72 | filelist = list(ff(self.path, '*.py', False)) |
| 73 | # This directory has many Python files. |
| 74 | self.assertGreater(len(filelist), 10) |
| 75 | self.assertIn(self.realpath, filelist) |
| 76 | self.assertNotIn(readme, filelist) |
| 77 | |
| 78 | # Look for .txt files in path where this file lives. |
| 79 | filelist = list(ff(self.path, '*.txt', False)) |
| 80 | self.assertNotEqual(len(filelist), 0) |
| 81 | self.assertNotIn(self.realpath, filelist) |
| 82 | self.assertIn(readme, filelist) |
| 83 | |
| 84 | # Look for non-matching pattern. |
| 85 | filelist = list(ff(self.path, 'grep.*', False)) |
| 86 | self.assertEqual(len(filelist), 0) |
| 87 | self.assertNotIn(self.realpath, filelist) |
| 88 | |
| 89 | def test_recurse(self): |
| 90 | ff = grep.findfiles |
nothing calls this directly
no test coverage detected