Beispiel #1
0
    def test_notifyHipchatFail(self):
        responses.add(responses.POST,
                      "https://api.hipchat.com/v1/",
                      json=True,
                      status=400)
        status_code = plugins.notify_hipchat(self.obj, self.message_template,
                                             ["devops"], CONSUL_HIPCHAT)

        self.assertNotEqual(200, status_code)
Beispiel #2
0
    def test_notifySlackHipchat(self):
        responses.add(responses.POST, "https://slack.com/api/chat.postMessage", json=True, status=200)
        responses.add(responses.POST, "https://api.hipchat.com/v1/", json=True, status=200)

        status_code = plugins.notify_slack(self.message_template, ["devops"], CONSUL_SLACK)

        self.assertEqual(200, status_code)

        status_code = 0

        status_code = plugins.notify_hipchat(self.obj, self.message_template, ["devops"], CONSUL_HIPCHAT)

        self.assertEqual(200, status_code)
Beispiel #3
0
    def test_notifySlackHipchat(self):
        responses.add(responses.POST,
                      "https://slack.com/api/chat.postMessage",
                      json=True,
                      status=200)
        responses.add(responses.POST,
                      "https://api.hipchat.com/v1/",
                      json=True,
                      status=200)

        status_code = plugins.notify_slack(self.message_template, ["devops"],
                                           CONSUL_SLACK)

        self.assertEqual(200, status_code)

        status_code = 0

        status_code = plugins.notify_hipchat(self.obj, self.message_template,
                                             ["devops"], CONSUL_HIPCHAT)

        self.assertEqual(200, status_code)
Beispiel #4
0
    def test_notifyHipchatFail(self):
        responses.add(responses.POST, "https://api.hipchat.com/v1/", json=True, status=400)
        status_code = plugins.notify_hipchat(self.obj, self.message_template, ["devops"], CONSUL_HIPCHAT)

        self.assertNotEqual(200, status_code)