"""Unit tests for Spotify Marquee Workflow.""" from unittest import mock from unittest.mock import MagicMock from feed_ingestion.flows.spotify_marquee.flow import Flow def test_decider(): """Test normal decider execution.""" schedule = MagicMock() flow = Flow() context = { 'context_date': '2017-08-27', 'licensor': 'theorchard', 'report_name': 'campaign_level' } flow.decider(schedule, context) schedule.assert_has_calls([ mock.call('bootstrap', mock.ANY), mock.call().result.get('bootstrap.stop'), mock.call('grab_drop_file', mock.ANY, requires=mock.ANY), mock.call().result.get('grab_drop_file.stop'), mock.call( 'create_temp_staging_raw_table', mock.ANY, requires=mock.ANY ), mock.call( 'load_temp_staging_raw_table', mock.ANY, requires=mock.ANY ), mock.call('populate_staging_raw', mock.ANY, requires=mock.ANY), mock.call('drop_temp_stage_table', mock.ANY, requires=mock.ANY), mock.call('mark_ingested_file', mock.ANY, requires=mock.ANY), mock.call('set_status_to_ingested', mock.ANY, requires=mock.ANY), ])