"""Common fixtures for Amazon Music.""" import pytest from feed_ingestion.flows.amazon_music import config, countries_config config_params = { 'feed_name': 'amazon_music', 'licensors': ['theorchard', 'sme'], 'reports': { 'test': { 'staging_raw_table': 'staging_raw_amazon_test', 'cucumber_feed_name': 'AmazonTest', 'awal_ftp_folder_name': 'Test', 'awal_report_name_in_filename': 'Test', 'unstable_countries': ['AT', 'CA', 'IN', 'ROE_EU', 'ROW_NA']}}, 'report_types': ['Playlist', 'Activity', 'User'], 'MAX_EXECUTION_TIMEOUT': 1 * 3600, 'file_template': '{org}_{country}_{date:%Y%m%d}_Daily_{report_type}_Report.txt.zip', 'drop_bucket': 'dev-feed-drop', 'archive_bucket': 'archive-bucket', 's3': { 'drop_path': { 'theorchard': 's3://dev-feed-drop/feed-drop' '/{cucumber_feed_name}/{licensor}/', 'sme': 's3://sme_test_bucket/amazon/in' '/{report_location}/{date:%Y/%m/%d}/' }, 'archive_path': 's3://archive-bucket/{cucumber_feed_name}/archives/' '{date:%Y-%m-%d}/{licensor}/', 'clean_dir': 'clean/', }, 'snowflake_error_limit': 1, 'file_name_regexp': config.file_name_regexp, 'sme_file_name_regexp': config.sme_file_name_regexp, } licensor_report_rules = { 'theorchard': { 'test': [ {'since': '2017-01-01', 'config': { 'ORCA': 'US,AT', 'ORED': 'US,AT', }} ], }, 'sme': { 'test': [ {'since': '2017-01-01', 'config': { 'SME1': 'AT,DE', 'SME2': 'US', }} ], }, } @pytest.fixture() def mock_config(monkeypatch): """Mock config.""" for attr, value in config_params.items(): monkeypatch.setattr(config, attr, value) monkeypatch.setattr(countries_config, 'licensor_report_rules', licensor_report_rules) @pytest.fixture() def mock_countries_config(monkeypatch): """Mock config.""" monkeypatch.setattr(countries_config, 'licensor_report_rules', licensor_report_rules)