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

Function test_annot_clean_contents

tests/test_general.py:113–126  ·  view source on GitHub ↗

Assert that annot contents cleaning actually is invoked.

()

Source from the content-addressed store, hash-verified

111
112
113def test_annot_clean_contents():
114 """Assert that annot contents cleaning actually is invoked."""
115 doc = pymupdf.open()
116 page = doc.new_page()
117 annot = page.add_highlight_annot((10, 10, 20, 20))
118
119 # the annotation appearance will not start with command b"q"
120
121
122 # invoke appearance stream cleaning and reformatting
123 annot.clean_contents()
124
125 # appearance stream should now indeed start with command b"q"
126 assert annot._getAP().startswith(b"q") == True
127
128
129def test_config():

Callers

nothing calls this directly

Calls 4

new_pageMethod · 0.80
add_highlight_annotMethod · 0.80
_getAPMethod · 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…