@@ -144,17 +144,30 @@ def test_pdf_complex_layout(svc: MockOCRService) -> None:
144144
145145
146146# ---------------------------------------------------------------------------
147- # pdf_multipage.pdf — pdfplumber/pdfminer fail (EOF); PyMuPDF fallback used
147+ # pdf_multipage.pdf
148148# ---------------------------------------------------------------------------
149149
150150
151151def test_pdf_multipage (svc : MockOCRService ) -> None :
152- # pdfplumber cannot open this file (Unexpected EOF), so _ocr_full_pages
153- # falls back to PyMuPDF for page rendering. Each page becomes one OCR block.
154152 expected = (
155- f"## Page 1\n \n \n { _OCR_BLOCK } \n \n \n "
156- f"## Page 2\n \n \n { _OCR_BLOCK } \n \n \n "
157- f"## Page 3\n \n \n { _OCR_BLOCK } "
153+ "## Page 1\n \n \n "
154+ "Page 1 - Content before image\n \n "
155+ "This is important text that appears BEFORE the image.\n \n \n \n "
156+ "*[Image OCR]\n MOCK_OCR_TEXT_12345\n [End OCR]*\n \n \n "
157+ "This text appears AFTER the image on page 1.\n \n "
158+ "More content follows here.\n \n \n "
159+ "## Page 2\n \n \n "
160+ "Page 2 - Content with image at end\n \n "
161+ "Main content of page 2 starts here.\n \n "
162+ "This is paragraph 1.\n \n "
163+ "This is paragraph 2.\n \n "
164+ "Final paragraph before image.\n \n \n \n "
165+ "*[Image OCR]\n MOCK_OCR_TEXT_12345\n [End OCR]*\n \n \n \n "
166+ "## Page 3\n \n \n "
167+ "Page 3 - Image at top\n \n \n \n "
168+ "*[Image OCR]\n MOCK_OCR_TEXT_12345\n [End OCR]*\n \n \n "
169+ "Content that follows the image.\n \n "
170+ "This text is AFTER the image."
158171 )
159172 assert _convert ("pdf_multipage.pdf" , svc ) == expected
160173
0 commit comments