|
|
@ -131,6 +131,19 @@ class NotifyTestCase(BaseTestCase): |
|
|
|
@patch("hc.api.transports.requests.post") |
|
|
|
def test_hipchat(self, mock_post): |
|
|
|
self._setup_data("hipchat", "123") |
|
|
|
mock_post.return_value.status_code = 204 |
|
|
|
|
|
|
|
self.channel.notify(self.check) |
|
|
|
n = Notification.objects.first() |
|
|
|
self.assertEqual(n.error, "") |
|
|
|
|
|
|
|
args, kwargs = mock_post.call_args |
|
|
|
json = kwargs["json"] |
|
|
|
self.assertIn("DOWN", json["message"]) |
|
|
|
|
|
|
|
@patch("hc.api.transports.requests.post") |
|
|
|
def test_pushover(self, mock_post): |
|
|
|
self._setup_data("po", "123|0") |
|
|
|
mock_post.return_value.status_code = 200 |
|
|
|
|
|
|
|
self.channel.notify(self.check) |
|
|
@ -138,4 +151,4 @@ class NotifyTestCase(BaseTestCase): |
|
|
|
|
|
|
|
args, kwargs = mock_post.call_args |
|
|
|
json = kwargs["json"] |
|
|
|
self.assertIn("DOWN", json["message"]) |
|
|
|
self.assertIn("DOWN", json["title"]) |