def setUp(self): super(TestWebhookMiddleware, self).setUp() self.ctx = utils.dummy_context() self.middleware = webhook_middleware.WebhookMiddleware(None) self.url_slices = { '00_url_base': 'http://HOST_IP:PORT/v1', '01_webhook_str': '/webhooks/', '02_webhook_id': 'WEBHOOK_ID', '03_trigger_str': '/trigger?', '04_version': 'V=1', '05_params': '&key=TEST_KEY', } self.credential = { 'auth_url': 'TEST_URL', 'user_id': '123', 'password': '******' }
def webhook_filter(app, conf, **local_conf): return webhook.WebhookMiddleware(app)