예제 #1
0
파일: bob.py 프로젝트: robochat/buildbit
 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)
예제 #2
0
 def test_no_match(self):
     for pat in [???]:
         res=fpmatch.filter(self.paths,pat=pat)
         self.assertTrue(res == pat)
예제 #3
0
 def test_direct_match(self):
     for pat in self.paths:
         res=fpmatch.filter(self.paths,pat=pat)
         self.assertTrue(res == pat)