()
| 2097 | |
| 2098 | |
| 2099 | def test_4702(): |
| 2100 | if os.environ.get('PYODIDE_ROOT'): |
| 2101 | # util.download() uses subprocess. |
| 2102 | print('test_4702(): not running on Pyodide - cannot run child processes.') |
| 2103 | return |
| 2104 | |
| 2105 | path = util.download( |
| 2106 | 'https://github.com/user-attachments/files/22403483/01995b6ca7837b52abaa24e38e8c076d.pdf', |
| 2107 | 'test_4702.pdf', |
| 2108 | ) |
| 2109 | with pymupdf.open(path) as document: |
| 2110 | for xref in range(1, document.xref_length()): |
| 2111 | print(f'{xref=}') |
| 2112 | try: |
| 2113 | _ = document.xref_object(xref) |
| 2114 | except Exception as e1: |
| 2115 | print(f'{e1=}') |
| 2116 | try: |
| 2117 | document.update_object(xref, "<<>>") |
| 2118 | except Exception as e2: |
| 2119 | print(f'{e2=}') |
| 2120 | raise |
| 2121 | wt = pymupdf.TOOLS.mupdf_warnings() |
| 2122 | assert wt == 'repairing PDF document' |
| 2123 | |
| 2124 | with pymupdf.open(path) as document: |
| 2125 | for xref in range(1, document.xref_length()): |
| 2126 | print(f'{xref=}') |
| 2127 | _ = document.xref_object(xref) |
| 2128 | wt = pymupdf.TOOLS.mupdf_warnings() |
| 2129 | assert wt == 'repairing PDF document' |
| 2130 | |
| 2131 | |
| 2132 | def test_4712(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…