def test_ignore_invalid_glob(self):
     bad_glob = "/path/to/Model[b-a]"
     glob.populate(bad_glob)
     d = PathList()
     d.add(bad_glob)
     d.glob()
     self.assertEqual(list(d)[0].fslash(), bad_glob)
 def test_glob_when_files_dont_match(self):
     glob.populate(self.other_files_on_disk)
     d = PathList()
     file = "/some/file.*.exr"
     d.add(file)
     d.glob()
     self.assertEqual(len(d), 0)
 def test_glob_dedups_when_many_files_match(self):
     glob.populate(self.some_files_on_disk)
     d = PathList()
     files = ["/some/file.*.exr", "/some/*.exr"]
     d.add(*files)
     d.glob()
     self.assertEqual(len(d), 20)
 def test_glob_when_files_match_with_range(self):
     glob.populate(self.some_files_on_disk)
     d = PathList()
     file = "/some/file.000[0-9].exr"
     d.add(file)
     d.glob()
     self.assertEqual(len(d), 9)
 def test_glob_when_files_match_with_question_mark(self):
     glob.populate(self.some_files_on_disk)
     d = PathList()
     file = "/some/file.00?0.exr"
     d.add(file)
     d.glob()
     self.assertEqual(len(d), 2)
 def test_glob_leaves_non_existent_unglobbable_entries_untouched(self):
     glob.populate(self.some_files_on_disk[:3])
     d = PathList()
     d.add("/some/file.*.exr", "/other/file1.exr", "/other/file2.exr")
     d.glob()
     self.assertEqual(len(d), 5)