24 lines
479 B
Python
24 lines
479 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
|
|
|
|
|
|
@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():
|
|
with open(os.path.join(TEST_DATA_DIR, "f2dc689ca794fccb8cd38b95f2bf6ba9.pdf"), "rb") as f:
|
|
yield f.read()
|