"""Unit tests for tasks of Store Specific Itunes Priority Workflow.""" from unittest.mock import MagicMock import pytest from feed_ingestion.flows.itunes_priority import config from feed_ingestion.flows.itunes_priority import tasks @pytest.fixture def context(): """Context for Store Specific Itunes Priority tasks.""" return {'activity': MagicMock()} @pytest.fixture def expected_bootstrap_response(context): """Response for bootstrap task.""" return { 'priority_sheet_id': 'someid', 'priority_table': 'DEV.TEST.PRIORITY_APPLEIDS', 's3_path': ( 's3://dev-cucumbers/DataAnalyticsDept/iTunes/' 'tickets/priority/priority_ticket_appleid.csv'), 'priority_email_list': [ 'ozaychenko@theorchard.com', 'leon@theorchard.com', 'datarequests@theorchard.com']} def test_bootstrap(monkeypatch, context, expected_bootstrap_response): """Test bootstrap task.""" monkeypatch.setattr(config, 'PRIORITY_TABLE', 'DEV.TEST.PRIORITY_APPLEIDS') monkeypatch.setattr( config, 'S3_PATH', 's3://dev-cucumbers/DataAnalyticsDept/' 'iTunes/tickets/priority/priority_ticket_appleid.csv') monkeypatch.setattr(config, 'PRIORITY_SHEET_ID', 'someid') result = tasks.bootstrap(**context) assert result == expected_bootstrap_response