"""Projections ETL flow tests.""" from unittest import mock from unittest import TestCase from unittest.mock import Mock from flows.projections.flow import Flow class FlowTest(TestCase): """Test case scaffolding.""" def test_decider(self): """Test the flow decision logic.""" schedule = Mock() schedule.return_value = Mock(result={}) Flow('test', 'test_projection', '1.0').decider(schedule) schedule.assert_has_calls([ mock.call('bootstrap', mock.ANY), mock.call('determine_anchor_date', mock.ANY, requires=mock.ANY), mock.call('create_temp_table', mock.ANY, requires=mock.ANY), mock.call('download_to_db', mock.ANY, requires=mock.ANY), mock.call('insert_new_data', mock.ANY, requires=mock.ANY), mock.call('drop_temp_table', mock.ANY, requires=mock.ANY), mock.call('archive_dropped_csv', mock.ANY, requires=mock.ANY), mock.call('set_final_status', mock.ANY, requires=mock.ANY), mock.call('send_success_notification', mock.ANY, requires=mock.ANY) ])