mirror of
https://github.com/allenai/olmocr.git
synced 2025-11-02 02:54:53 +00:00
More tests
This commit is contained in:
parent
3153aea260
commit
c9e1a4c540
BIN
tests/gnarly_pdfs/load_v_error.pdf
Normal file
BIN
tests/gnarly_pdfs/load_v_error.pdf
Normal file
Binary file not shown.
@ -143,6 +143,17 @@ class AnchorTest(unittest.TestCase):
|
||||
|
||||
self.assertEqual(anchor_text.strip(), "Page dimensions: 612.0x792.0")
|
||||
|
||||
def testCannotLoad(self):
|
||||
local_pdf_path = os.path.join(os.path.dirname(__file__), "gnarly_pdfs", "load_v_error.pdf")
|
||||
|
||||
reader = PdfReader(local_pdf_path)
|
||||
page = 5
|
||||
anchor_text = get_anchor_text(local_pdf_path, page, pdf_engine="pdfreport", target_length=6000)
|
||||
|
||||
print(anchor_text)
|
||||
print(len(anchor_text))
|
||||
self.assertLess(len(anchor_text), 6000)
|
||||
|
||||
# TODO This one still fails
|
||||
def testExcessiveMapAnchor(self):
|
||||
local_pdf_path = os.path.join(os.path.dirname(__file__), "gnarly_pdfs", "map1.pdf")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user