From 7eed6160c1aad28d40c322032bb7d7a809f6c5ab Mon Sep 17 00:00:00 2001 From: Austin Date: Thu, 14 Dec 2017 16:07:24 -0800 Subject: [PATCH] Adds test for pagertree --- hc/api/tests/test_notify.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hc/api/tests/test_notify.py b/hc/api/tests/test_notify.py index d65d6121..d9cc9e7e 100644 --- a/hc/api/tests/test_notify.py +++ b/hc/api/tests/test_notify.py @@ -283,6 +283,18 @@ class NotifyTestCase(BaseTestCase): self.assertEqual(payload["event_type"], "trigger") self.assertEqual(payload["service_key"], "456") + @patch("hc.api.transports.requests.request") + def test_pd(self, mock_post): + self._setup_data("pagertree", "123") + mock_post.return_value.status_code = 200 + + self.channel.notify(self.check) + assert Notification.objects.count() == 1 + + args, kwargs = mock_post.call_args + payload = kwargs["json"] + self.assertEqual(payload["event_type"], "trigger") + @patch("hc.api.transports.requests.request") def test_slack(self, mock_post): self._setup_data("slack", "123")