def test_copy_all_files(self): try: shutil.rmtree(DST) except FileNotFoundError: pass src = len(copywise.find_files(SRC, None)) copywise.copy_ext(SRC, DST, None) dst = len(copywise.find_files(DST, None)) self.assertAlmostEqual(src, dst)
def test_copy_pdf_epub_mobi_files(self): try: shutil.rmtree(DST) except FileNotFoundError: pass src = len(copywise.find_files(SRC, ['pdf', 'epub', 'files'])) copywise.copy_ext(SRC, DST, ['pdf', 'epub', 'files']) dst = len(copywise.find_files(DST, ['pdf', 'epub', 'files'])) self.assertAlmostEqual(src, dst)
def test_find_all_files(self): files = copywise.find_files(SRC, None) self.assertEqual((len(files)), 8 + 7 + 8)
def test_find_all_files_except_pdf(self): files = copywise.find_files(SRC, include=None, exclude='pdf') self.assertEqual(len(files), 7 + 8)
def test_find_all_pdf_files(self): pdf = copywise.find_files(SRC, 'pdf') self.assertEqual(len(pdf), 8)