2019-04-08 16:51:44 +02:00
|
|
|
import os
|
|
|
|
|
|
|
|
from passerelle.utils.conversion import to_pdf
|
|
|
|
|
|
|
|
|
|
|
|
def test_pdf_to_pdf_do_nothing():
|
2022-03-17 17:56:30 +01:00
|
|
|
with open(os.path.join(os.path.dirname(__file__), 'data', 'minimal.pdf'), 'rb') as fd:
|
|
|
|
pdf = fd.read()
|
2019-04-08 16:51:44 +02:00
|
|
|
assert to_pdf(pdf) == pdf
|
2022-03-17 17:56:30 +01:00
|
|
|
with open(os.path.join(os.path.dirname(__file__), 'data', 'minimal_bom.pdf'), 'rb') as fd:
|
|
|
|
pdf = fd.read()
|
2019-04-08 16:51:44 +02:00
|
|
|
assert to_pdf(pdf) == pdf
|
2022-03-17 17:56:30 +01:00
|
|
|
with open(os.path.join(os.path.dirname(__file__), 'data', 'minimal_bomutf8.pdf'), 'rb') as fd:
|
|
|
|
pdf = fd.read()
|
2019-04-08 16:51:44 +02:00
|
|
|
assert to_pdf(pdf) == pdf
|