From b85745a5390a867d106849c784b55608e27fd08e Mon Sep 17 00:00:00 2001 From: geisserml Date: Thu, 19 Dec 2024 00:11:31 +0100 Subject: [PATCH] Update test expectations --- docs/devel/changelog_staging.md | 3 +- tests/expectations/pdfinfo_multipage.txt | 42 ++++++++++++------------ tests/expectations/toc_maxdepth.txt | 2 +- tests_old/test_pageobject.py | 7 ++-- 4 files changed, 28 insertions(+), 26 deletions(-) diff --git a/docs/devel/changelog_staging.md b/docs/devel/changelog_staging.md index 5fccac9df..1ad8f3946 100644 --- a/docs/devel/changelog_staging.md +++ b/docs/devel/changelog_staging.md @@ -8,7 +8,8 @@ - `PdfPage.get_objects()`: Don't register pageobjects as children, because they don't need to be closed by the caller when part of a page. This avoids excessive caching of weakrefs that are not cleaned up with the object they refer to. - Fixed another dotted filepath blunder in the `extract-images` CLI. (The `PdfImage.extract()` API is not affected this time.) - Fixed installation with reference bindings (`PDFIUM_BINDINGS=reference`) by adding a missing `mkdir` call. (In older versions, this can be worked around by unpacking the sdist and creating the missing directory manually before installation.) -- Autorelease: Swapped default condition for minor/patch update, as pypdfium2 changes are likely more API-significant than pdfium updates. Added ability for manual override. +- Updated test expectations: due to changes in pdfium, some numbers are now slightly different. - Fixed conda packaging: It is now required to explicitly specify `-c defaults` with `--override-channels`, presumably due to an upstream change. +- Autorelease: Swapped default condition for minor/patch update, as pypdfium2 changes are likely more API-significant than pdfium updates. Added ability for manual override. - Bumped workflows to Python 3.12. - Updated docs on licensing. diff --git a/tests/expectations/pdfinfo_multipage.txt b/tests/expectations/pdfinfo_multipage.txt index 0df34f990..b838ec8db 100644 --- a/tests/expectations/pdfinfo_multipage.txt +++ b/tests/expectations/pdfinfo_multipage.txt @@ -11,31 +11,31 @@ Metadata: ModDate: D:20211209144456Z # Page 1 -Size: (595.2756, 841.8897) +Size: (595.2756, 841.8898) Rotation: 0 -Bounding Box: (0.0, 0.0, 595.2756, 841.8897) -MediaBox: (0.0, 0.0, 595.2756, 841.8897) -CropBox: (0.0, 0.0, 595.2756, 841.8897) -BleedBox: (0.0, 0.0, 595.2756, 841.8897) -TrimBox: (0.0, 0.0, 595.2756, 841.8897) -ArtBox: (0.0, 0.0, 595.2756, 841.8897) +Bounding Box: (0.0, 0.0, 595.2756, 841.8898) +MediaBox: (0.0, 0.0, 595.2756, 841.8898) +CropBox: (0.0, 0.0, 595.2756, 841.8898) +BleedBox: (0.0, 0.0, 595.2756, 841.8898) +TrimBox: (0.0, 0.0, 595.2756, 841.8898) +ArtBox: (0.0, 0.0, 595.2756, 841.8898) # Page 2 -Size: (595.2756, 419.5275) +Size: (595.2756, 419.5276) Rotation: 0 -Bounding Box: (0.0, 0.0, 595.2756, 419.5275) -MediaBox: (0.0, 0.0, 595.2756, 419.5275) -CropBox: (0.0, 0.0, 595.2756, 419.5275) -BleedBox: (0.0, 0.0, 595.2756, 419.5275) -TrimBox: (0.0, 0.0, 595.2756, 419.5275) -ArtBox: (0.0, 0.0, 595.2756, 419.5275) +Bounding Box: (0.0, 0.0, 595.2756, 419.5276) +MediaBox: (0.0, 0.0, 595.2756, 419.5276) +CropBox: (0.0, 0.0, 595.2756, 419.5276) +BleedBox: (0.0, 0.0, 595.2756, 419.5276) +TrimBox: (0.0, 0.0, 595.2756, 419.5276) +ArtBox: (0.0, 0.0, 595.2756, 419.5276) # Page 3 -Size: (297.6378, 419.5275) +Size: (297.6378, 419.5276) Rotation: 0 -Bounding Box: (0.0, 0.0, 297.6378, 419.5275) -MediaBox: (0.0, 0.0, 297.6378, 419.5275) -CropBox: (0.0, 0.0, 297.6378, 419.5275) -BleedBox: (0.0, 0.0, 297.6378, 419.5275) -TrimBox: (0.0, 0.0, 297.6378, 419.5275) -ArtBox: (0.0, 0.0, 297.6378, 419.5275) +Bounding Box: (0.0, 0.0, 297.6378, 419.5276) +MediaBox: (0.0, 0.0, 297.6378, 419.5276) +CropBox: (0.0, 0.0, 297.6378, 419.5276) +BleedBox: (0.0, 0.0, 297.6378, 419.5276) +TrimBox: (0.0, 0.0, 297.6378, 419.5276) +ArtBox: (0.0, 0.0, 297.6378, 419.5276) diff --git a/tests/expectations/toc_maxdepth.txt b/tests/expectations/toc_maxdepth.txt index 814bfceea..beeacb932 100644 --- a/tests/expectations/toc_maxdepth.txt +++ b/tests/expectations/toc_maxdepth.txt @@ -13,7 +13,7 @@ [+] 1.1.1.1.1.1.1.1.1.1.1.1.outline -> 1 # FitH [632.946] [+] 1.1.1.1.1.1.1.1.1.1.1.1.1.outline -> 1 # FitH [632.946] [+] 1.1.1.1.1.1.1.1.1.1.1.1.1.1.outline -> 1 # FitH [632.946] -[+] 2.outline -> 2 # FitH [749.4771] +[+] 2.outline -> 2 # FitH [749.477] [+] 2.1.outline -> 2 # FitH [699.36] [+] 2.1.1.outline -> 2 # FitH [628.74] [*] 2.1.1.1.outline -> 2 # FitH [583.179] diff --git a/tests_old/test_pageobject.py b/tests_old/test_pageobject.py index afa2a3396..27f093ca7 100644 --- a/tests_old/test_pageobject.py +++ b/tests_old/test_pageobject.py @@ -201,9 +201,10 @@ def test_image_get_bitmap(render): if render: assert bitmap.format == pdfium_c.FPDFBitmap_BGRA assert bitmap.n_channels == 4 - assert bitmap.width == 216 - assert bitmap.height == 90 - assert bitmap.stride == 864 + # Somewhere between pdfium 6462 and 6899, size/stride expectation changed here + assert bitmap.width == 217 + assert bitmap.height == 91 + assert bitmap.stride == 868 assert bitmap.rev_byteorder is False output_path = OutputDir / "extract_rendered.png" else: