def test_listing_files_doesnt_include_directories(self): dir = os.path.join(self.temp_dir, 'test') os.mkdir(dir) all = [] for f in files(self.temp_dir): all.append(f) self.assertEqual(self.test_files, all)
def test_listing_files_doesnt_include_directories(self): dir = os.path.join(self.temp_dir, "test") os.mkdir(dir) all = [] for f in files(self.temp_dir): all.append(f) self.assertEqual(self.test_files, all)
def test_listing_all_files(self): all = [] for f in files(self.temp_dir): all.append(f) self.assertEqual(self.test_files, all)
def test_listing_all_dot_pnms(self): pnms = [] expected = ['test1.pnm', 'test2.pnm'] for f in files(self.temp_dir, '.pnm'): pnms.append(f) self.assertEqual(pnms, expected)
def test_listing_all_pnms_doesnt_list_jpg(self): pnms = [] for f in files(self.temp_dir, 'pnm'): pnms.append(f) self.assertNotIn('test3.jpg', pnms)
def test_listing_all_dot_pnms(self): pnms = [] expected = ["test1.pnm", "test2.pnm"] for f in files(self.temp_dir, ".pnm"): pnms.append(f) self.assertEqual(pnms, expected)
def test_listing_all_pnms_doesnt_list_jpg(self): pnms = [] for f in files(self.temp_dir, "pnm"): pnms.append(f) self.assertNotIn("test3.jpg", pnms)