import os import alph pdffiles = [ ["test1.pdf", 2] ] def testDSCTokens(): assert (alph.util.dscutil._dsctokens("a b (c d)") == ["a", "b", "(c d)"]) assert (alph.util.dscutil._dsctokens("a b (c d) ") == ["a", "b", "(c d)"]) assert (alph.util.dscutil._dsctokens("( ) a ") == ["( )", "a"]) def _rm(file): try: os.remove(file) except: pass def testPDF(): outdsc = "tmpdsc" for f in pdffiles: _rm(outdsc) assert alph.util.dscutil.reliablePDF2DSC("testdata/"+f[0], outdsc) _rm(outdsc)