Example #1
0
 def test_no_match_extension(self):
     f_names = self.f_names
     extensions = ["*.pdf"]
     filtered = filter_extension(f_names, extensions)
     self.assertEqual([], filtered)
Example #2
0
 def test_false_extension(self):
     f_names = self.f_names
     extensions = ["txt"]
     filtered = filter_extension(f_names, extensions)
     self.assertEqual([], filtered)
Example #3
0
 def test_single_extension(self):
     f_names = self.f_names
     extensions = ["*.txt"]
     filtered = filter_extension(f_names, extensions)
     self.assertEqual([f_names[0]], filtered)
Example #4
0
 def test_two_extensions(self):
     f_names = self.f_names
     extensions = ["*.txt", "*.jpg"]
     filtered = filter_extension(f_names, extensions)
     self.assertEqual([f_names[0], f_names[1]], filtered)
Example #5
0
 def test_all_extensions(self):
     f_names = self.f_names
     extensions = ["*.*"]
     filtered = filter_extension(f_names, extensions)
     self.assertEqual(f_names, filtered)