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