()
| 436 | assert rms < 1 |
| 437 | |
| 438 | def test_3758(): |
| 439 | # This test requires input file that is not public, so is usually not |
| 440 | # available. |
| 441 | path = os.path.normpath(f'{__file__}/../../../test_3758.pdf') |
| 442 | if not os.path.exists(path): |
| 443 | print(f'test_3758(): not running because does not exist: {path=}.') |
| 444 | return |
| 445 | import json |
| 446 | with pymupdf.open(path) as document: |
| 447 | for page in document: |
| 448 | info = json.loads(page.get_text('json', flags=pymupdf.TEXTFLAGS_TEXT)) |
| 449 | for block_ind, block in enumerate(info['blocks']): |
| 450 | for line_ind, line in enumerate(block['lines']): |
| 451 | for span_ind, span in enumerate(line['spans']): |
| 452 | # print(span) |
| 453 | page.add_redact_annot(pymupdf.Rect(*span['bbox'])) |
| 454 | page.apply_redactions() |
| 455 | wt = pymupdf.TOOLS.mupdf_warnings() |
| 456 | assert wt |
| 457 | |
| 458 | |
| 459 | def test_parent(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…