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

Function test_redact4

tests/test_annots.py:214–226  ·  view source on GitHub ↗

Test for removing text and keeping graphics.

()

Source from the content-addressed store, hash-verified

212
213
214def test_redact4():
215 """Test for removing text and keeping graphics."""
216 if not hasattr(pymupdf, "mupdf"):
217 print("Not executing 'test_redact4' in classic")
218 return
219 filename = os.path.join(scriptdir, "resources", "symbol-list.pdf")
220 doc = pymupdf.open(filename)
221 page = doc[0]
222 line_art = page.get_drawings()
223 page.add_redact_annot(page.rect)
224 page.apply_redactions(graphics=0)
225 assert not page.get_text("words")
226 assert line_art == page.get_drawings()
227
228
229def test_1645():

Callers

nothing calls this directly

Calls 4

get_drawingsMethod · 0.80
add_redact_annotMethod · 0.80
apply_redactionsMethod · 0.80
get_textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…