コード例 #1
0
ファイル: main_test.py プロジェクト: caesarxuchao/test-infra
 def get_response(self, event, body):
     if isinstance(body, dict):
         body = json.dumps(body)
     signature = handlers.make_signature(body)
     return app.post('/webhook', body,
         {'X-Github-Event': event,
          'X-Hub-Signature': signature})
コード例 #2
0
ファイル: main_test.py プロジェクト: ivosandoval/test-infra
 def get_response(self, event, body):
     if isinstance(body, dict):
         body = json.dumps(body)
     signature = handlers.make_signature(body)
     return app.post('/webhook', body, {
         'X-Github-Event': event,
         'X-Hub-Signature': signature
     })
コード例 #3
0
ファイル: main_test.py プロジェクト: ivosandoval/test-infra
 def test_webhook_bad_sig(self):
     body = json.dumps({'action': 'blah'})
     signature = handlers.make_signature(body + 'foo')
     app.post('/webhook',
              body, {
                  'X-Github-Event': 'test',
                  'X-Hub-Signature': signature
              },
              status=400)
コード例 #4
0
ファイル: main_test.py プロジェクト: squawell/test-infra
 def get_response(self, event, body):
     if isinstance(body, dict):
         body = json.dumps(body)
     signature = handlers.make_signature(body)
     resp = app.post('/webhook', body,
         {'X-Github-Event': event,
          'X-Hub-Signature': signature})
     for task in self.taskqueue.get_filtered_tasks():
         deferred.run(task.payload)
     return resp
コード例 #5
0
 def get(self):
     """Receives the warmup request."""
     self.response.headers['Content-Type'] = 'text/plain'
     handlers.make_signature('load the secret!')
     self.response.write('Warmup successful')
コード例 #6
0
ファイル: main_test.py プロジェクト: caesarxuchao/test-infra
 def test_webhook_bad_sig(self):
     body = json.dumps({'action': 'blah'})
     signature = handlers.make_signature(body + 'foo')
     app.post('/webhook', body,
         {'X-Github-Event': 'test',
          'X-Hub-Signature': signature}, status=400)