oncall-engine/engine/apps/alerts/tests/test_custom_webhook_result.py
Matias Bordese 2a89374adf
Add escalation chain support for new webhooks (#1654)
Allow setting a webhook as escalation chain policy step.
2023-04-05 12:03:55 +00:00

17 lines
537 B
Python

from unittest.mock import call, patch
import pytest
from apps.alerts.tasks import custom_webhook_result
@pytest.mark.django_db
def test_custom_webhook_result_executes_webhook():
webhook_id = 42
alert_group_id = 13
escalation_policy_id = 11
with patch("apps.webhooks.tasks.trigger_webhook.execute_webhook.apply_async") as mock_execute:
custom_webhook_result(webhook_id, alert_group_id, escalation_policy_id)
assert mock_execute.call_args == call((webhook_id, alert_group_id, None, escalation_policy_id))