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
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
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]
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
def test_filter_dir(self): assert checker(dir=1)(self.root.join("sampledir"))