Beispiel #1
0
 def expand_wildcard(self,fpath):        
     """Uses the glob module to search the file system and an altered glob module - fpmatch
     to search the meta rules.
     """
     matches = glob.glob(fpath)
     if fpmatch.has_magic(fpath): 
         matches += fpmatch.filter(self.rules.iterkeys(),fpath)
     else: matches += [fpmatch.strip_specials(fpath)] #can still have single escaped chars in sets when magic==False
     if len(matches) == 0: raise AssertionError("No matching file or rule found for %r" %fpath)
     return dedup(matches)
Beispiel #2
0
 def test_no_match(self):
     for pat in [???]:
         res=fpmatch.filter(self.paths,pat=pat)
         self.assertTrue(res == pat)
Beispiel #3
0
 def test_direct_match(self):
     for pat in self.paths:
         res=fpmatch.filter(self.paths,pat=pat)
         self.assertTrue(res == pat)