Files
unredact/tests/conftest.py
T
Alex-GilbertandClaude Opus 4.6 8857793759 feat: add analyze_spot_redaction for single-box analysis
Add a synchronous function that runs the analysis mini-pipeline on a
single known bounding box using cached OCR data. This enables spot
redaction endpoints to get full analysis (font, left/right context text,
pixel alignment offsets) without needing LLM detection.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 12:39:57 -06:00

23 lines
571 B
Python

from pathlib import Path
import pytest
FIXTURES_DIR = Path(__file__).parent / "fixtures"
@pytest.fixture
def sample_pdf() -> Path:
"""Path to the sample Epstein PDF for testing."""
pdf = Path("/home/alex/Documents/EFTA00554620.pdf")
if not pdf.exists():
pytest.skip("Sample PDF not available")
return pdf
@pytest.fixture
def sample_page_image(sample_pdf):
"""Rasterize the first page of the sample PDF as a PIL Image."""
from unredact.pipeline.rasterize import rasterize_pdf
pages = rasterize_pdf(sample_pdf)
return pages[0]