"""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_msg_body(): """Mock SQS message body for store product workflow.""" return { 'product_id': '12345', 'review_queue_id': '67890', 'operation_type': 'add_to_index' } @pytest.fixture def mock_product_data(): """Mock indexable product data.""" return { 'id': '12345', 'name': 'Test Product', 'status': 'active' } @pytest.fixture def mock_step_function_payload(mock_msg_body): """Mock Step Function payload structure.""" return { 'data': { 'product_id': mock_msg_body['product_id'], 'review_queue_id': mock_msg_body['review_queue_id'], 'use_auto_approval': True, 'indexing_inputs': [mock_msg_body], 'product_metadata_s3_url': 's3://test-bucket/product/12345/67890.json', 'is_integration_test': False } }