def test_no_match_extension(self): f_names = self.f_names extensions = ["*.pdf"] filtered = filter_extension(f_names, extensions) self.assertEqual([], filtered)
def test_false_extension(self): f_names = self.f_names extensions = ["txt"] filtered = filter_extension(f_names, extensions) self.assertEqual([], filtered)
def test_single_extension(self): f_names = self.f_names extensions = ["*.txt"] filtered = filter_extension(f_names, extensions) self.assertEqual([f_names[0]], filtered)
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)
def test_all_extensions(self): f_names = self.f_names extensions = ["*.*"] filtered = filter_extension(f_names, extensions) self.assertEqual(f_names, filtered)