"""Unit tests for Youtube Weekly Workflow.""" from unittest import mock from unittest.mock import MagicMock from feed_ingestion.flows.youtube_weekly.flow import Flow def test_decider(): """Test normal decider execution.""" schedule = MagicMock() flow = Flow() flow.decider(schedule) schedule.assert_has_calls([ mock.call('check_feed_status', mock.ANY), mock.call().result.get('check_feed_status.stop'), mock.call('bootstrap', mock.ANY, requires=mock.ANY), mock.call().result.get('bootstrap.stop'), mock.call('grab_drop_files', mock.ANY, requires=mock.ANY), mock.call().result.get('grab_drop_files.stop'), mock.call('set_status_to_downloaded', mock.ANY, requires=mock.ANY), mock.call( 'load_staging_raw_table', mock.ANY, requires=mock.ANY), mock.call( 'set_status_to_populated_raw_table', mock.ANY, requires=mock.ANY), mock.call( 'load_staging_fact_table', mock.ANY, requires=mock.ANY), mock.call('load_fact_tables', mock.ANY, requires=mock.ANY) ])