"""Conftest. This file gets picked up when running py.test tests: http://pytest.org/latest/writing_plugins.html#conftest """ import pytest from snowflake_etl.flows.sql2sf.config import SourcesConf @pytest.fixture def sources_mock(): """Fixture returning the mock of SourcesConf instance.""" sources = SourcesConf() sources.conf = { 's3_destinations': { 'mysql': { 'data': 's3://{env}-db-data/sql2sf/', 'schema': 's3://{env}-db-data/sql2sf/'}, 'redshift': { 'data': 's3://{env}-db-data/redshift/', 'schema': 's3://{env}-db-data/redshift/'}}, 'queries': { 'mysql': {'snapshot': 'SELECT...'}, 'redshift': { 'snapshot': 'SELECT...', 'sync_incremental': 'SELECT... BETWEEN', 'date_range': 'SELECT... BETWEEN'}}, 'db_hosts': { 'research_collections': { 'db_type': 'mysql', 'schemas': { 'ppb_collections': { 'tables': { 'track_delivery_history_7': { 'primary_key': 'id', 'chunk_size': 20000000, 'unload_in_chunks': True, 'sanity_threshold': 0, 'file_format': "FIELD_DELIMITER='\t' " "RECORD_DELIMITER='\n'"}}}}}, 'ows_rds': { 'db_type': 'mysql', 'schemas': { 'sales_goals': { 'db_config': {'host': 'testhost', 'port': 10, 'user': 'testuser', 'password': 'pass'}, 'tables': { 'sales_goal': { 'sanity_threshold': 0, 'wrap_to_stripspecialchars_long': True, 'validate_schema': False}}}, 'youtube_ownership': { 'tables': { 'yt_api_log': { 'sanity_threshold': 0, 'wrap_to_stripspecialchars': True, 'unload_in_chunks': True, 'chunk_size': 20000000, 'primary_key': 'id'}}}}}, 'redshift04': { 'unload_options': 'GZIP ESCAPE', 'db_type': 'redshift', 'schemas': { 'production': { 'tables': { 'dim_artist': {'transient': True}, 'fact_analytics': {'sync_incremental_support': True}}}}}}} return sources