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

Function test_full_toc

tests/test_toc.py:29–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27
28
29def test_full_toc():
30 if not hasattr(pymupdf, "mupdf"):
31 # Classic implementation does not have fix for this test.
32 print(f"Not running test_full_toc on classic implementation.")
33 return
34 expected_path = f"{scriptdir}/resources/full_toc.txt"
35 expected = pathlib.Path(expected_path).read_bytes()
36 # Github windows x32 seems to insert \r characters; maybe something to
37 # do with the Python installation's line endings settings.
38 expected = expected.decode("utf8")
39 expected = expected.replace('\r', '')
40 toc = "\n".join([str(t) for t in doc.get_toc(False)])
41 toc += "\n"
42 assert toc == expected
43
44
45def test_erase_toc():

Callers

nothing calls this directly

Calls 1

get_tocMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…