"""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_approve_event(): """Mock approve event.""" return load_file_json('tests/sample_approval.json') @pytest.fixture def mock_reject_event(): """Mock reject event.""" return load_file_json('tests/sample_rejection.json') @pytest.fixture def mock_will_not_deliver(): """Mock will not deliver reject event.""" return load_file_json('tests/sample_will_not_deliver.json')