コード例 #1
0
    def setUp(self):
        self.request = MockRequest()
        # Google Code simply transmit the payload as an UTF-8 JSON body
        self.request.content = StringIO.StringIO(googleCodeJsonBody)
        self.request.received_headers = {
            'Google-Code-Project-Hosting-Hook-Hmac': '85910bf93ba5c266402d9328b0c7a856',
            'Content-Length': '509',
            'Accept-Encoding': 'gzip',
            'User-Agent': 'Google Code Project Hosting (+http://code.google.com/p/support/wiki/PostCommitWebHooks)',
            'Host': 'buildbot6-lopter.dotcloud.com:19457',
            'Content-Type': 'application/json; charset=UTF-8'
        }

        self.changeHook = change_hook.ChangeHookResource(dialects={
                'googlecode': {
                    'secret_key': 'FSP3p-Ghdn4T0oqX',
                    'branch': 'test'
                }
        })
コード例 #2
0
 def setUp(self):
     changeDict = {
         "category": ["mycat"],
         "files": [json.dumps(['file1', 'file2'])],
         "repository": ["myrepo"],
         "when": [1234],
         "who": ["Santa Claus"],
         "number": [2],
         "comments": ["a comment"],
         "project": ["a project"],
         "at": ["sometime"],
         "branch": ["a branch"],
         "revlink": ["a revlink"],
         "properties": [json.dumps({
             "prop1": "val1",
             "prop2": "val2"
         })],
         "revision": [99]
     }
     self.request = MockRequest(changeDict)
     self.changeHook = change_hook.ChangeHookResource(
         dialects={'base': True})
コード例 #3
0
 def setUp(self):
     changeDict = {"payload": [gitJsonPayload]}
     self.request = MockRequest(changeDict)
     self.changeHook = change_hook.ChangeHookResource(
         dialects={'github': True})
 def setUp(self):
     self.request = MockRequest()
     self.changeHook = change_hook.ChangeHookResource(
         dialects={'base': True})