"""Unit tests for release approval workflow.""" from garcon.activity import Activity import pytest from activity_detector.flows.release_approval.flow import Flow class TestFlow(object): """Tests for Flow.""" @pytest.fixture def flow(self): """Create flow.""" return Flow() @pytest.fixture def run_flow(self, flow, mock_schedule, mock_context): """Run flow.""" flow.decider(mock_schedule, mock_context) def test_decider_schedules_detect_ingested_releases( self, mock_schedule, run_flow): """Test decider schedules activity detect_ingested_releases.""" (name, activity), _ = mock_schedule.call_args_list[0] assert name == 'detect_ingested_releases' assert isinstance(activity, Activity) assert activity.runner.tasks[0].__name__ == 'detect_ingested_releases'