Browse Source

Adds test for pagertree

pull/143/head
Austin 7 years ago
parent
commit
7eed6160c1
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      hc/api/tests/test_notify.py

+ 12
- 0
hc/api/tests/test_notify.py View File

@ -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")


Loading…
Cancel
Save