Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_pdfinfo_from_path(self):
start_time = time.time()
info = pdfinfo_from_path("./tests/test.pdf")
self.assertTrue(info.get("Pages", 0) == 1)
print("test_pdfinfo_from_path: {} sec".format(time.time() - start_time))
def test_pdfinfo_from_path_241(self):
start_time = time.time()
info = pdfinfo_from_path("./tests/test_241.pdf")
self.assertTrue(info.get("Pages", 0) == 241)
print("test_pdfinfo_from_path_241: {} sec".format(time.time() - start_time))
def test_pdfinfo_from_path_invalid(self):
start_time = time.time()
try:
info = pdfinfo_from_path("./tests/test.jpg")
raise Exception("This should not happen")
except PDFPageCountError:
pass
print("test_pdfinfo_from_path_241: {} sec".format(time.time() - start_time))