"""Shared test mocks.""" import json import pytest def load_file(filepath): """Load file.""" with open(filepath) as event_file: return event_file.read() def load_file_json(filepath): """Load json from file.""" return json.loads(load_file(filepath)) @pytest.fixture def mock_event(): """Mock event.""" return load_file_json('tests/sample_event.json') @pytest.fixture def mock_single_event(): """Mock single event.""" return { 'Records': [ { 'messageId': 'abc', 'body': '{"operation": "update", "product_id": 1, "review_queue_id": 1}' } ] }