def test_or(self): file_name_list = sorted( glob(os.path.join(self.tmp_dir, "pref*", "**", "*(.py|.c)"), dirs=False)) self.assertEqual( file_name_list, sorted([ self.testfile1_path, self.testfile2_path, self.testfile3_path ]))
def test_curdir(self): self.assertTrue(self.matches_standard_glob(glob("*"), "*"))
def test_random(self): path = os.path.join(os.getcwd(), "*", "*.py") self.assertTrue(self.matches_standard_glob(glob(path), path))
def test_empty(self): self.assertEqual(glob(""), [])
def test_none(self): dir_name_list = sorted( glob(os.path.join(self.tmp_dir, "**", "*"), files=False, dirs=False)) self.assertEqual(dir_name_list, [])
def test_miss(self): dir_name_list = sorted( glob(os.path.join("*", "something", "that", "isnt", "there"))) self.assertEqual(dir_name_list, [])
def test_no_dirs(self): dir_name_list = sorted( glob(os.path.join(self.tmp_dir, "**", "random*"), dirs=False)) self.assertEqual(dir_name_list, [])
def test_dirs(self): dir_name_list = sorted( glob(os.path.join(self.tmp_dir, "**", "random*"), files=False)) self.assertEqual(dir_name_list, sorted([self.tmp_subdir2, self.tmp_subdir3]))