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

Function test_2556

tests/test_drawings.py:165–176  ·  view source on GitHub ↗

Ensure that incomplete clip paths will be properly ignored.

()

Source from the content-addressed store, hash-verified

163
164
165def test_2556():
166 """Ensure that incomplete clip paths will be properly ignored."""
167 doc = pymupdf.open() # new empty PDF
168 page = doc.new_page() # new page
169 # following contains an incomplete clip
170 c = b"q 50 697.6 400 100.0 re W n q 0 0 m W n Q "
171 xref = doc.get_new_xref() # prepare /Contents object for page
172 doc.update_object(xref, "<<>>") # new xref now is a dictionary
173 doc.update_stream(xref, c) # store drawing commands
174 page.set_contents(xref) # give the page this xref as /Contents
175 # following will bring down interpreter if fix not installed
176 assert page.get_drawings(extended=True)
177
178
179def test_3207():

Callers

nothing calls this directly

Calls 6

new_pageMethod · 0.80
get_new_xrefMethod · 0.80
update_objectMethod · 0.80
update_streamMethod · 0.80
set_contentsMethod · 0.80
get_drawingsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…