circuitforge-core/tests/test_documents
pyr0ball 408ab64c55 test(documents): add OCR and ImportError coverage for PDFExtractor
- Add module-level guards for pytesseract and PIL.Image (enables patching in tests)
- Move `import io` from inside _ocr_page to module-level stdlib imports
- Extract _ensure_pil_image() helper with TypeError guard so isinstance check
  does not blow up when Image is patched to a MagicMock in tests
- Add 3 new tests: pdfplumber=None ImportError, sparse-page OCR fallback,
  OCR render failure returns empty chunk
- Coverage: 96% (up from 64%)
2026-05-04 08:39:31 -07:00
..
__init__.py feat: hardware detection, cf-docuvision service, documents ingestion pipeline 2026-04-02 18:53:25 -07:00
test_client.py feat: hardware detection, cf-docuvision service, documents ingestion pipeline 2026-04-02 18:53:25 -07:00
test_ingest.py feat: hardware detection, cf-docuvision service, documents ingestion pipeline 2026-04-02 18:53:25 -07:00
test_models.py feat: hardware detection, cf-docuvision service, documents ingestion pipeline 2026-04-02 18:53:25 -07:00
test_pdf.py test(documents): add OCR and ImportError coverage for PDFExtractor 2026-05-04 08:39:31 -07:00