def run_test_glob_match_both_ways(self, result, pattern, path, include_dotfiles=False): self.assertEqual(result, glob_match(pattern, path, include_dotfiles=include_dotfiles), "glob_match('%s', '%s', include_dotfiles=%s) should be %s" % (pattern, path, include_dotfiles, result)) self.assertEqual(result, self.glob_match_using_glob_walk(pattern, path, include_dotfiles=include_dotfiles), "glob_match_using_glob_walk('%s', '%s', include_dotfiles=%s) should be %s" % (pattern, path, include_dotfiles, result))
def mock_iglob(pattern): for path in all_paths: if glob_match(pattern, path): yield path