Matthias Bisping 0cf8e047c5 Refactoring
2023-02-06 13:22:33 +01:00

28 lines
595 B
Python

import os
import fpdf
import pytest
from image_prediction.locations import TEST_DATA_DIR
from test.utils.generation.pdf import add_image, pdf_stream, stream_pdf_bytes
@pytest.fixture
def pdf(image_metadata_pairs):
pdf = fpdf.FPDF(unit="pt")
for pair in image_metadata_pairs:
add_image(pdf, pair)
return pdf_stream(pdf)
@pytest.fixture
def real_pdf(dvc_test_data):
yield from stream_pdf_bytes(TEST_DATA_DIR / "f2dc689ca794fccb8cd38b95f2bf6ba9.pdf")
@pytest.fixture
def bad_xref_pdf(dvc_test_data):
yield from stream_pdf_bytes(TEST_DATA_DIR / "bad_xref.pdf")