From 8f46204ee2deb8427b0c308635e48d2220b60308 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Thu, 23 Jan 2025 22:05:22 -0500 Subject: [PATCH] test: test popple (probably) --- tests/test_image.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/test_image.py diff --git a/tests/test_image.py b/tests/test_image.py new file mode 100644 index 0000000..7663e69 --- /dev/null +++ b/tests/test_image.py @@ -0,0 +1,26 @@ +import sys +from pathlib import Path + +import pytest + +import playa +from paves.image import popple + +THISDIR = Path(__file__).parent + + +@pytest.mark.skipif( + sys.platform != "linux", + reason="Poppler Probably not Present on Proprietary Platforms", +) +def test_popple(): + path = THISDIR / "contrib" / "PSC_Station.pdf" + with playa.open(path) as pdf: + images = list(popple(path)) + assert len(images) == len(pdf.pages) + images = list(popple(pdf)) + assert len(images) == len(pdf.pages) + images = list(popple(pdf.pages[1:6])) + assert len(images) == 5 + images = list(popple(pdf.pages[[3, 4, 5, 9, 10]])) + assert len(images) == 5