MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / test_pageids

Function test_pageids

tests/test_nonpdf.py:19–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17
18
19def test_pageids():
20 assert doc.chapter_count == 7
21 assert doc.last_location == (6, 1)
22 assert doc.prev_location((6, 0)) == (5, 11)
23 assert doc.next_location((5, 11)) == (6, 0)
24 # Check page numbers have no gaps:
25 i = 0
26 for chapter in range(doc.chapter_count):
27 for cpno in range(doc.chapter_page_count(chapter)):
28 assert doc.page_number_from_location((chapter, cpno)) == i
29 i += 1
30
31def test_layout():
32 """Memorize a page location, re-layout with ISO-A4, assert pre-determined location."""

Callers

nothing calls this directly

Calls 4

prev_locationMethod · 0.80
next_locationMethod · 0.80
chapter_page_countMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…