|
@ -205,6 +205,18 @@ class NotifyTestCase(BaseTestCase): |
|
|
n = Notification.objects.get() |
|
|
n = Notification.objects.get() |
|
|
self.assertEqual(n.error, "Connection timed out") |
|
|
self.assertEqual(n.error, "Connection timed out") |
|
|
|
|
|
|
|
|
|
|
|
@patch("hc.api.transports.requests.request") |
|
|
|
|
|
def test_slack_with_tabs_in_schedule(self, mock_post): |
|
|
|
|
|
self._setup_data("slack", "123") |
|
|
|
|
|
self.check.kind = "cron" |
|
|
|
|
|
self.check.schedule = "*\t* * * *" |
|
|
|
|
|
self.check.save() |
|
|
|
|
|
mock_post.return_value.status_code = 200 |
|
|
|
|
|
|
|
|
|
|
|
self.channel.notify(self.check) |
|
|
|
|
|
self.assertEqual(Notification.objects.count(), 1) |
|
|
|
|
|
self.assertTrue(mock_post.called) |
|
|
|
|
|
|
|
|
@patch("hc.api.transports.requests.request") |
|
|
@patch("hc.api.transports.requests.request") |
|
|
def test_hipchat(self, mock_post): |
|
|
def test_hipchat(self, mock_post): |
|
|
self._setup_data("hipchat", "123") |
|
|
self._setup_data("hipchat", "123") |
|
|