Example #1
0
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
Example #2
0
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
Example #3
0
def printFileName(filename):
    print()
    print("--------------------------->" + filename)
    convertMcf(filename, False)  # throwing away the result
Example #4
0
def printFileName(filename):
    print
    print("--------------------------->" + filename)
    resultFlag = convertMcf(filename, False)