SIENTIAPDE-1182

Add test for handling cases with no receiver groups in Alerts workflow

- Implemented a new test case to verify the behavior of the Alerts workflow when no receiver groups are provided, ensuring that the workflow executes correctly without unnecessary processing.
This commit is contained in:
vitor-aignosi
2025-09-05 12:57:59 -03:00
parent c4733f4daa
commit 678c149cf2

View File

@@ -117,6 +117,22 @@ async def test_run_no_data(workflow_mock, alerts):
workflow_mock.execute_local_activity_method.assert_not_called()
@mark.asyncio
@patch("orchestrator.workflows.alerts.workflow", new_callable=AsyncMock)
async def test_run_no_receiver_groups(workflow_mock, alerts):
workflow_mock.execute_local_activity_method.return_value = {}
input_data = {
'schedule_name': 'test-schedule-name',
'notification_ttl': 300,
'sent_ttl': 600
}
await alerts.run(input_data)
assert workflow_mock.execute_child_workflow.call_count == 1
@mark.asyncio
@patch("orchestrator.workflows.alerts.workflow", new_callable=AsyncMock)
async def test_run_no_log_report(workflow_mock, alerts):