Fix backend tests

Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
This commit is contained in:
Christoph Auer 2024-08-27 15:18:35 +02:00
parent 4980b71185
commit e59ea8e04e
3 changed files with 7 additions and 7 deletions

View File

@ -321,7 +321,7 @@ class LayoutModel:
clusters, page.cells, page.size.height clusters, page.cells, page.size.height
) )
# draw_clusters_and_cells() draw_clusters_and_cells()
page.predictions.layout = LayoutPrediction(clusters=clusters) page.predictions.layout = LayoutPrediction(clusters=clusters)

View File

@ -17,7 +17,7 @@ def test_doc_path():
def test_get_text_from_rect(test_doc_path): def test_get_text_from_rect(test_doc_path):
doc_backend = DoclingParseDocumentBackend(test_doc_path) doc_backend = DoclingParseDocumentBackend(test_doc_path, "123456xyz")
page_backend: DoclingParsePageBackend = doc_backend.load_page(0) page_backend: DoclingParsePageBackend = doc_backend.load_page(0)
# Get the title text of the DocLayNet paper # Get the title text of the DocLayNet paper
@ -30,7 +30,7 @@ def test_get_text_from_rect(test_doc_path):
def test_crop_page_image(test_doc_path): def test_crop_page_image(test_doc_path):
doc_backend = DoclingParseDocumentBackend(test_doc_path) doc_backend = DoclingParseDocumentBackend(test_doc_path, "123456xyz")
page_backend: DoclingParsePageBackend = doc_backend.load_page(0) page_backend: DoclingParsePageBackend = doc_backend.load_page(0)
# Crop out "Figure 1" from the DocLayNet paper # Crop out "Figure 1" from the DocLayNet paper
@ -41,5 +41,5 @@ def test_crop_page_image(test_doc_path):
def test_num_pages(test_doc_path): def test_num_pages(test_doc_path):
doc_backend = DoclingParseDocumentBackend(test_doc_path) doc_backend = DoclingParseDocumentBackend(test_doc_path, "123456xyz")
doc_backend.page_count() == 9 doc_backend.page_count() == 9

View File

@ -15,7 +15,7 @@ def test_doc_path():
def test_get_text_from_rect(test_doc_path): def test_get_text_from_rect(test_doc_path):
doc_backend = PyPdfiumDocumentBackend(test_doc_path) doc_backend = PyPdfiumDocumentBackend(test_doc_path, "123456xyz")
page_backend: PyPdfiumPageBackend = doc_backend.load_page(0) page_backend: PyPdfiumPageBackend = doc_backend.load_page(0)
# Get the title text of the DocLayNet paper # Get the title text of the DocLayNet paper
@ -28,7 +28,7 @@ def test_get_text_from_rect(test_doc_path):
def test_crop_page_image(test_doc_path): def test_crop_page_image(test_doc_path):
doc_backend = PyPdfiumDocumentBackend(test_doc_path) doc_backend = PyPdfiumDocumentBackend(test_doc_path, "123456xyz")
page_backend: PyPdfiumPageBackend = doc_backend.load_page(0) page_backend: PyPdfiumPageBackend = doc_backend.load_page(0)
# Crop out "Figure 1" from the DocLayNet paper # Crop out "Figure 1" from the DocLayNet paper
@ -39,5 +39,5 @@ def test_crop_page_image(test_doc_path):
def test_num_pages(test_doc_path): def test_num_pages(test_doc_path):
doc_backend = PyPdfiumDocumentBackend(test_doc_path) doc_backend = PyPdfiumDocumentBackend(test_doc_path, "123456xyz")
doc_backend.page_count() == 9 doc_backend.page_count() == 9