Intelex / tests /test_pdf.py
yakub
Initial cloud-ready commit
b2b6341
Raw
History Blame Contribute Delete
683 Bytes
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from pathlib import Path
from backend.ingestion.pdf_loader import ingest_pdf
# Put any small PDF file in your project folder
# and change this path to point to it
pdf_path = Path("test.pdf") # ← place any PDF here
if not pdf_path.exists():
print("[ERROR] Please place a PDF file named 'test.pdf' in the project root")
else:
result = ingest_pdf(pdf_path, "test.pdf")
print("\n[SUCCESS] PDF ingestion result:")
print(f" source_id : {result['source_id']}")
print(f" chunk_count: {result['chunk_count']}")
print(f" title : {result['title']}")