()
| 27 | |
| 28 | |
| 29 | def test_full_toc(): |
| 30 | if not hasattr(pymupdf, "mupdf"): |
| 31 | # Classic implementation does not have fix for this test. |
| 32 | print(f"Not running test_full_toc on classic implementation.") |
| 33 | return |
| 34 | expected_path = f"{scriptdir}/resources/full_toc.txt" |
| 35 | expected = pathlib.Path(expected_path).read_bytes() |
| 36 | # Github windows x32 seems to insert \r characters; maybe something to |
| 37 | # do with the Python installation's line endings settings. |
| 38 | expected = expected.decode("utf8") |
| 39 | expected = expected.replace('\r', '') |
| 40 | toc = "\n".join([str(t) for t in doc.get_toc(False)]) |
| 41 | toc += "\n" |
| 42 | assert toc == expected |
| 43 | |
| 44 | |
| 45 | def test_erase_toc(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…