feat: add real PDF ingestion workflow
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
from pathlib import Path
|
||||
|
||||
from app.services.plan_ingestion import inspect_pdf
|
||||
|
||||
|
||||
def test_sample_pdf_detects_two_plan_regions() -> None:
|
||||
workspace = Path(__file__).resolve().parents[3]
|
||||
sample = workspace / "11-2-104-模型.pdf"
|
||||
|
||||
result = inspect_pdf(sample.read_bytes())
|
||||
|
||||
assert result.page_count == 1
|
||||
assert result.vector_based is True
|
||||
assert result.vector_element_count > 10_000
|
||||
assert result.preview_width == 1600
|
||||
assert len(result.regions) == 2
|
||||
assert result.regions[0].name.startswith("上方")
|
||||
assert result.regions[0].recommended is True
|
||||
assert result.regions[1].name.startswith("下方")
|
||||
Reference in New Issue
Block a user