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

Function test_redact2

tests/test_annots.py:184–197  ·  view source on GitHub ↗

Test for keeping text and removing graphics.

()

Source from the content-addressed store, hash-verified

182
183
184def test_redact2():
185 """Test for keeping text and removing graphics."""
186 if not hasattr(pymupdf, "mupdf"):
187 print("Not executing 'test_redact2' in classic")
188 return
189 filename = os.path.join(scriptdir, "resources", "symbol-list.pdf")
190 doc = pymupdf.open(filename)
191 page = doc[0]
192 all_text0 = page.get_text("words")
193 page.add_redact_annot(page.rect)
194 page.apply_redactions(text=1)
195 t = page.get_text("words")
196 assert t == all_text0
197 assert not page.get_drawings()
198
199
200def test_redact3():

Callers

nothing calls this directly

Calls 4

add_redact_annotMethod · 0.80
apply_redactionsMethod · 0.80
get_drawingsMethod · 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…