Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

Point PDF table mocks at the refactored implementation owner

myhlolie5a672b42bd8
diff --git a/tests/unittest/test_flash_pdf_tables.py b/tests/unittest/test_flash_pdf_tables.py
index 558cbe9c..50ac701b 100644
--- a/tests/unittest/test_flash_pdf_tables.py
+++ b/tests/unittest/test_flash_pdf_tables.py
@@ -7,6 +7,7 @@ import pytest
from docvortex.analyzers.native.pdf import geometry
from docvortex.analyzers.native.pdf import models
from docvortex.analyzers.native.pdf import tables
+from docvortex.analyzers.native.pdf import table_materialization
from docvortex.document.pdf.document import PDFPathInfo
@@ -316,7 +317,7 @@ def test_filled_grid_materialization_uses_existing_spatial_projection(
source.page_size,
)[0]
projection = MagicMock(return_value="inside-left inside-right")
- monkeypatch.setattr(tables, "project_pdf_table_text", projection)
+ monkeypatch.setattr(table_materialization, "project_pdf_table_text", projection)
blocks, annotation_blocks, claimed = tables._materialize_table_blocks(
source,
@@ -470,7 +471,7 @@ def test_table_core_reclaims_semantic_line_without_touching_outer_marginals(
line_indices={0},
)
projection = MagicMock(return_value="cell\ntable tail")
- monkeypatch.setattr(tables, "project_pdf_table_text", projection)
+ monkeypatch.setattr(table_materialization, "project_pdf_table_text", projection)
blocks, annotation_blocks, claimed = tables._materialize_table_blocks(
source,
@@ -1342,7 +1343,7 @@ def test_materialize_table_externalizes_multiline_annotations_once(
],
)
projection = MagicMock(return_value="Header Body")
- monkeypatch.setattr(tables, "project_pdf_table_text", projection)
+ monkeypatch.setattr(table_materialization, "project_pdf_table_text", projection)
table_blocks, annotation_blocks, claimed = tables._materialize_table_blocks(
source,
@@ -1488,7 +1489,7 @@ def test_invalid_table_annotation_falls_back_to_full_table_projection(
],
)
projection = MagicMock(return_value="body")
- monkeypatch.setattr(tables, "project_pdf_table_text", projection)
+ monkeypatch.setattr(table_materialization, "project_pdf_table_text", projection)
table_blocks, annotation_blocks, claimed = tables._materialize_table_blocks(
source,
@@ -2000,7 +2001,7 @@ def test_failed_table_projection_does_not_claim_text(
projection = MagicMock(return_value="")
if projection_mode == "error":
projection.side_effect = RuntimeError("projection failed")
- monkeypatch.setattr(tables, "project_pdf_table_text", projection)
+ monkeypatch.setattr(table_materialization, "project_pdf_table_text", projection)
blocks, annotation_blocks, claimed = tables._materialize_table_blocks(
source,
diff --git a/tests/unittest/test_native_pdf_table_pipeline.py b/tests/unittest/test_native_pdf_table_pipeline.py
index ea304025..48e8801f 100644
--- a/tests/unittest/test_native_pdf_table_pipeline.py
+++ b/tests/unittest/test_native_pdf_table_pipeline.py
@@ -18,6 +18,7 @@ from mineru.backend.analysis.pdf import tables as pdf_tables
from mineru.backend.analysis.pdf import window as pdf_window
from docvortex.analyzers.native.pdf import models as flash_models
from docvortex.analyzers.native.pdf import tables as flash_tables
+from docvortex.analyzers.native.pdf import table_materialization
from docvortex.document.pdf.document import PDFDocument
from docvortex.document.pdf.document import PDFPageTextGeometry
from mineru.types import RAW_FORMULA_NUMBER, BlockType
@@ -71,8 +72,8 @@ def test_flash_materialization_prefers_native_html_and_keeps_claims(
)
html = "<table><tbody><tr><td>A</td><td>B</td></tr></tbody></table>"
projection = MagicMock(return_value="fallback")
- monkeypatch.setattr(flash_tables, "_recover_native_table_html", MagicMock(return_value=html))
- monkeypatch.setattr(flash_tables, "project_pdf_table_text", projection)
+ monkeypatch.setattr(table_materialization, "_recover_native_table_html", MagicMock(return_value=html))
+ monkeypatch.setattr(table_materialization, "project_pdf_table_text", projection)
blocks, annotations, claimed = flash_tables._materialize_table_blocks(
source,