"""Shared test mocks.""" import json import pytest def load_file(filepath): """Load file.""" with open(filepath) as event_file: read_data = event_file.read() return read_data 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_ineligible_event(): """Mock event.""" return load_file_json('tests/sample_ineligible_event.json') @pytest.fixture def mock_product(): """Mock product.""" return { 'data': { 'product': { 'upc': 11111 } } } @pytest.fixture def mock_review_queue_item(): """Mock review queue item.""" return { 'data': { 'reviewQueueItem': { 'queueName': 'escalation', 'movedToQueueByIdentity': {'id': 1} } } } @pytest.fixture def mock_invalid_review_queue_item(): """Mock invalid review queue item.""" return { 'data': { 'reviewQueueItem': { 'queueName': 'initial', 'movedToQueueByIdentity': {'id': 1} } } }