Skip to content

Commit

Permalink
test: test popple (probably)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhdaines committed Jan 24, 2025
1 parent 58eeb01 commit 8f46204
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/test_image.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8f46204

Please sign in to comment.