2022-03-31 19:01:32 +02:00

19 lines
530 B
Python

import json
import os
from image_prediction.default_objects import load_pipeline
from image_prediction.locations import TEST_DATA_DIR
def test_pipeline():
pipeline = load_pipeline(verbose=False)
with open(os.path.join(TEST_DATA_DIR, "f2dc689ca794fccb8cd38b95f2bf6ba9.pdf"), "rb") as f:
predictions = list(pipeline(f.read()))
with open(os.path.join(TEST_DATA_DIR, "f2dc689ca794fccb8cd38b95f2bf6ba9_predictions.json"), "r") as f:
expectations = json.load(f)
assert predictions == expectations