"""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_release_correction_obj(): """Mock release correction object.""" return load_file_json('tests/sample_release_correction.json') @pytest.fixture def mock_invalid_rc_object(): """Mock invalid release correction object.""" return load_file_json('tests/sample_release_correction_invalid.json') @pytest.fixture def mock_input_data(): """Mock structured input data.""" return load_file_json('tests/sample_input_data.json')