Assert that page contents cleaning actually is invoked.
()
| 94 | |
| 95 | |
| 96 | def test_page_clean_contents(): |
| 97 | """Assert that page contents cleaning actually is invoked.""" |
| 98 | doc = pymupdf.open() |
| 99 | page = doc.new_page() |
| 100 | |
| 101 | # draw two rectangles - will lead to two /Contents objects |
| 102 | page.draw_rect((10, 10, 20, 20)) |
| 103 | page.draw_rect((20, 20, 30, 30)) |
| 104 | assert len(page.get_contents()) == 2 |
| 105 | assert page.read_contents().startswith(b"q") == False |
| 106 | |
| 107 | # clean / consolidate into one /Contents object |
| 108 | page.clean_contents() |
| 109 | assert len(page.get_contents()) == 1 |
| 110 | assert page.read_contents().startswith(b"q") == True |
| 111 | |
| 112 | |
| 113 | def test_annot_clean_contents(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…