예제 #1
0
 def test_get_filenames_match_regex(self):
     filenames = list(
         data_processing.get_filenames(self.data_dir, match_regex='f1'))
     self.assertEqual(filenames, ['f1.html.corrected.txt'])
     filenames = list(
         data_processing.get_filenames(self.data_dir, match_regex='foo'))
     self.assertEqual(filenames, [])
예제 #2
0
 def test_get_filenames_match_regex(self, datadir):
     filenames = list(
         data_processing.get_filenames(datadir, match_regex='f1'))
     assert filenames == ['f1.html.corrected.txt']
     filenames = list(
         data_processing.get_filenames(datadir, match_regex='foo'))
     assert filenames == []
예제 #3
0
 def test_get_filenames_extension(self):
     filenames = list(
         data_processing.get_filenames(self.data_dir, extension='.txt'))
     self.assertEqual(filenames, [
         '{}.html.corrected.txt'.format(froot) for froot in self.fileroots
     ])
     filenames = list(
         data_processing.get_filenames(self.data_dir, extension='.foo'))
     self.assertEqual(filenames, [])
예제 #4
0
 def test_get_filenames_extension(self, fileroots, datadir):
     filenames = list(
         data_processing.get_filenames(datadir, extension='.txt'))
     assert (filenames == [
         '{}.html.corrected.txt'.format(froot) for froot in fileroots
     ])
     filenames = list(
         data_processing.get_filenames(datadir, extension='.foo'))
     assert filenames == []
예제 #5
0
 def test_get_filenames_full_path(self):
     filenames = list(
         data_processing.get_filenames(self.data_dir, full_path=True))
     self.assertEqual(filenames, [
         os.path.join(self.data_dir, '{}.html.corrected.txt'.format(froot))
         for froot in self.fileroots
     ])
예제 #6
0
 def test_get_filenames_full_path(self, fileroots, datadir):
     filenames = list(data_processing.get_filenames(datadir,
                                                    full_path=True))
     assert (filenames == [
         os.path.join(datadir, "{}.html.corrected.txt".format(froot))
         for froot in fileroots
     ])
예제 #7
0
 def test_get_filenames(self, fileroots, datadir):
     filenames = list(data_processing.get_filenames(datadir))
     assert (filenames == [
         "{}.html.corrected.txt".format(froot) for froot in fileroots
     ])