()
| 59 | assert detected |
| 60 | |
| 61 | def test_2608(): |
| 62 | flags = (pymupdf.TEXT_DEHYPHENATE | pymupdf.TEXT_MEDIABOX_CLIP) |
| 63 | with pymupdf.open(os.path.abspath(f'{__file__}/../../tests/resources/2201.00069.pdf')) as doc: |
| 64 | page = doc[0] |
| 65 | blocks = page.get_text_blocks(flags=flags) |
| 66 | text = blocks[10][4] |
| 67 | with open(os.path.abspath(f'{__file__}/../../tests/test_2608_out'), 'wb') as f: |
| 68 | f.write(text.encode('utf8')) |
| 69 | path_expected = os.path.normpath(f'{__file__}/../../tests/resources/test_2608_expected') |
| 70 | path_expected_1_26 = os.path.normpath(f'{__file__}/../../tests/resources/test_2608_expected_1.26') |
| 71 | if pymupdf.mupdf_version_tuple >= (1, 27): |
| 72 | path_expected2 = path_expected |
| 73 | else: |
| 74 | path_expected2 = path_expected_1_26 |
| 75 | with open(path_expected2, 'rb') as f: |
| 76 | expected = f.read().decode('utf8') |
| 77 | # Github windows x32 seems to insert \r characters; maybe something to |
| 78 | # do with the Python installation's line endings settings. |
| 79 | expected = expected.replace('\r', '') |
| 80 | print(f'test_2608(): {text.encode("utf8")=}') |
| 81 | print(f'test_2608(): {expected.encode("utf8")=}') |
| 82 | assert text == expected |
| 83 | |
| 84 | def test_fontarchive(): |
| 85 | if os.environ.get('PYODIDE_ROOT'): |
nothing calls this directly
no test coverage detected
searching dependent graphs…