def tryToBuildBook(keepDoublePages): inFile = str(Path(Path.cwd(), 'tests', 'testClipart', 'testClipart.mcf')) outFile = str( Path(Path.cwd(), 'tests', 'testClipart', 'testClipart.mcf.pdf')) if os.path.exists(outFile) == True: os.remove(outFile) assert os.path.exists(outFile) == False convertMcf(inFile, keepDoublePages) assert Path(outFile).exists() == True #check the pdf contents # we could also test more sophisticated things, like colors or compare images. readerObj = PdfReader(outFile) numPages = len(readerObj.pages) assert numPages == 6
def tryToBuildBook(keepDoublePages): inFile = str(Path(Path.cwd(), 'tests', 'unittest_fotobook.mcf')) outFile = str(Path(Path.cwd(), 'tests', 'unittest_fotobook.mcf.pdf')) if os.path.exists(outFile) == True: os.remove(outFile) assert os.path.exists(outFile) == False convertMcf(inFile, keepDoublePages) assert Path(outFile).exists() == True #check the pdf contents readerObj = PdfReader(outFile) numPages = len(readerObj.pages) if keepDoublePages: assert numPages == 15 else: assert numPages == 28
def printFileName(filename): print() print("--------------------------->" + filename) convertMcf(filename, False) # throwing away the result
def printFileName(filename): print print("--------------------------->" + filename) resultFlag = convertMcf(filename, False)