"""Shared test mocks.""" import json import httpx import pytest def load_file_json(filepath): """Load json from file.""" with open(filepath) as event_file: read_data = event_file.read() return json.loads(read_data) @pytest.fixture(scope='session') def mock_event(): """Mock event.""" return load_file_json('tests/unit/msk/mock_msk_event.json') @pytest.fixture(scope='session') def mock_empty_event(): """Mock empty event.""" return load_file_json('tests/unit/msk/mock_empty_msk_event.json') @pytest.fixture(scope='session') def mock_review_queue_event(): """Mock MSK event from content_review.review_queue.""" return load_file_json('tests/unit/msk/mock_msk_review_queue_event.json') @pytest.fixture(scope='session') def mock_event_publisher_event(): """Mock MSK event from EventPublisher class.""" return load_file_json('tests/unit/msk/mock_event_publisher_product_review_event.json') @pytest.fixture def mock_common_graphql_query_args(): """Mock common graphql query args.""" return { 'service_name': 'graphql-router', 'identity_id': '034d10ec-9dfb-4c37-9b8b-58b725750e8f', 'profile_id': '91305', 'profile_type': 'ContentProfile', 'correlation_id': None, 'headers': {'Orchard-Roles': 'review_digital_audio'}, 'timeout': httpx.Timeout(60) }