def test_files_in_subdir_with_exclude(self): self._create_dir('tests') foo_txt = self._create_file('tests', 'foo.txt') bar_txt = self._create_file('tests', 'bar.txt') fileset = FileSet(self.basedir, include='tests/*.txt', exclude='bar.*') assert foo_txt in fileset and bar_txt not in fileset
def test_top_level_files(self): foo_txt = self._create_file('foo.txt') bar_txt = self._create_file('bar.txt') fileset = FileSet(self.basedir) assert foo_txt in fileset and bar_txt in fileset
def test_files_in_subdir(self): self._create_dir('tests') foo_txt = self._create_file('tests', 'foo.txt') bar_txt = self._create_file('tests', 'bar.txt') fileset = FileSet(self.basedir) assert foo_txt in fileset and bar_txt in fileset
def test_empty(self): fileset = FileSet(self.basedir) self.assertRaises(StopIteration, iter(fileset).next)