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

Function test_wrapcontents

tests/test_general.py:79–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77
78
79def test_wrapcontents():
80 doc = pymupdf.open(filename)
81 page = doc[0]
82 page.wrap_contents()
83 xref = page.get_contents()[0]
84 cont = page.read_contents()
85 doc.update_stream(xref, cont)
86 page.set_contents(xref)
87 assert len(page.get_contents()) == 1
88 page.clean_contents()
89 wt = pymupdf.TOOLS.mupdf_warnings()
90 if (1, 26, 0) <= pymupdf.mupdf_version_tuple < (1, 27):
91 assert wt == 'bogus font ascent/descent values (0 / 0)\nPDF stream Length incorrect'
92 else:
93 assert wt == 'PDF stream Length incorrect'
94
95
96def test_page_clean_contents():

Callers

nothing calls this directly

Calls 7

wrap_contentsMethod · 0.80
get_contentsMethod · 0.80
read_contentsMethod · 0.80
update_streamMethod · 0.80
set_contentsMethod · 0.80
mupdf_warningsMethod · 0.80
clean_contentsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…