"""Shared fixtures.""" from unittest.mock import MagicMock from src import base import pytest @pytest.fixture def neo4j_driver_mock(mocker): """Patch neo4j_driver with a mock session that supports context management.""" session_mock = MagicMock() neo4j_driver_patch = mocker.patch.object(base, 'neo4j_driver') neo4j_driver_patch.session.return_value.__enter__.return_value = session_mock return session_mock @pytest.fixture def mock_dependencies(mocker): """Mock the dependencies for testing purposes in the 'src.app' module.""" return { 'get_pending': mocker.patch('src.app.get_pending_hfa_request_from_publishing'), 'neo4j_synced': mocker.patch('src.app.neo4j_synced_tracks'), 'filter_synced': mocker.patch('src.app.filter_synced_results'), 'upload': mocker.patch('src.app.upload_to_s3'), 'fetch_batches': mocker.patch('src.app.fetch_synced_track_data_in_batches'), 'config_env': mocker.patch('src.app.config.ENVIRONMENT', 'test'), 'config_bucket': mocker.patch('src.app.config.S3_BUCKET_NAME', 'my-bucket'), 'config_tmp_dir': mocker.patch('src.app.config.S3_TMP_FILE_DIR', 'tmp/'), 'batch_size': mocker.patch('src.app.config.BATCH_SIZE', 2) }