Пример #1
0
 def _iterfiles(self):
     from py.__.path.common import checker
     base = self.getpath()
     for x in base.visit(checker(file=1, notext='.pyc'),
                         rec=checker(dotfile=0)):
         yield x
Пример #2
0
 def test_visit_endswith(self):
     l = []
     for i in self.root.visit(checker(endswith="file")):
         l.append(i.relto(self.root))
     assert self.root.sep.join(["sampledir", "otherfile"]) in l
     assert "samplefile" in l
Пример #3
0
 def test_listdir_sorted(self):
     l = self.root.listdir(checker(basestarts="sample"), sort=True)
     assert self.root.join('sampledir') == l[0]
     assert self.root.join('samplefile') == l[1]
     assert self.root.join('samplepickle') == l[2]
Пример #4
0
 def test_listdir_filter(self):
     l = self.root.listdir(checker(dir=1))
     assert self.root.join('sampledir') in l
     assert not self.root.join('samplefile') in l
Пример #5
0
 def test_filter_dir(self):
     assert checker(dir=1)(self.root.join("sampledir"))
Пример #6
0
 def _iterfiles(self):
     from py.__.path.common import checker
     base = self.getpath()
     for x in base.visit(checker(file=1, notext='.pyc'),
                         rec=checker(dotfile=0)):
         yield x