()
| 522 | |
| 523 | |
| 524 | def test_4180(): |
| 525 | path = os.path.normpath(f'{__file__}/../../tests/resources/test_4180.pdf') |
| 526 | with pymupdf.open(path) as document: |
| 527 | page = document[0] |
| 528 | regions = page.search_for('Reference is made') |
| 529 | for region in regions: |
| 530 | page.add_redact_annot(region, fill=(0, 0, 0)) |
| 531 | page.apply_redactions() |
| 532 | pixmap = page.get_pixmap() |
| 533 | path_out = os.path.normpath(f'{__file__}/../../tests/resources/test_4180_out.png') |
| 534 | pixmap.save(path_out) |
| 535 | |
| 536 | path_expected = os.path.normpath(f'{__file__}/../../tests/resources/test_4180_expected.png') |
| 537 | rms = gentle_compare.pixmaps_rms(path_expected, pixmap) |
| 538 | pixmap_diff = gentle_compare.pixmaps_diff(path_expected, pixmap) |
| 539 | path_diff = os.path.normpath(f'{__file__}/../../tests/resources/test_4180_diff.png') |
| 540 | pixmap_diff.save(path_diff) |
| 541 | print(f'{rms=}') |
| 542 | assert rms < 0.01 |
| 543 | |
| 544 | |
| 545 | def test_4182(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…