MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / test_2238

Function test_2238

tests/test_general.py:406–430  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

404
405
406def test_2238():
407 filepath = f'{scriptdir}/resources/test2238.pdf'
408 doc = pymupdf.open(filepath)
409 wt = pymupdf.TOOLS.mupdf_warnings()
410 wt_expected = ''
411 wt_expected += 'garbage bytes before version marker\n'
412 wt_expected += 'syntax error: expected \'obj\' keyword (6 0 ?)\n'
413 wt_expected += 'trying to repair broken xref\n'
414 wt_expected += 'repairing PDF document'
415 assert wt == wt_expected, f'{wt=}'
416 first_page = doc.load_page(0).get_text('text', clip=pymupdf.INFINITE_RECT())
417 last_page = doc.load_page(-1).get_text('text', clip=pymupdf.INFINITE_RECT())
418
419 print(f'first_page={first_page!r}')
420 print(f'last_page={last_page!r}')
421 assert first_page == 'Hello World\n'
422 assert last_page == 'Hello World\n'
423
424 first_page = doc.load_page(0).get_text('text')
425 last_page = doc.load_page(-1).get_text('text')
426
427 print(f'first_page={first_page!r}')
428 print(f'last_page={last_page!r}')
429 assert first_page == 'Hello World\n'
430 assert last_page == 'Hello World\n'
431
432
433def test_2093():

Callers

nothing calls this directly

Calls 3

mupdf_warningsMethod · 0.80
load_pageMethod · 0.80
get_textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…