def test_webhook_message_data(self):
     notification = VerificationNotification('https://thebluealliance.com/',
                                             'password')
     self.assertIsNotNone(notification.webhook_message_data)
     verification_key = notification.webhook_message_data.get(
         'verification_key', None)
     self.assertIsNotNone(verification_key)
Example #2
0
    def verify_webhook(url, secret):
        """ Immediately dispatch a Verification to a webhook """
        from models.notifications.verification import VerificationNotification
        notification = VerificationNotification(url, secret)

        from models.notifications.requests.webhook_request import WebhookRequest
        webhook_request = WebhookRequest(notification, url, secret)
        logging.info('Verification - {}'.format(str(webhook_request)))

        webhook_request.send()
        logging.info('Verification Key - {}'.format(notification.verification_key))

        return notification.verification_key
 def test_str(self):
     notification = VerificationNotification('https://thebluealliance.com/',
                                             'password')
     self.assertTrue("{'verification_key': " in str(notification))
 def test_data_payload(self):
     notification = VerificationNotification('https://thebluealliance.com/',
                                             'password')
     self.assertIsNone(notification.data_payload)
 def test_type(self):
     self.assertEqual(VerificationNotification._type(),
                      NotificationType.VERIFICATION)