コード例 #1
0
    def create_subscriptions(self, repositories):
        watch_payload = json.dumps({'subscribed': True, 'ignored': False})

        for reponame in repositories:
            logging.info('create subscription: %s' % reponame)
            github.put('repos/%s/subscription' % reponame, self.config,
                       payload=watch_payload)
コード例 #2
0
ファイル: updater.py プロジェクト: iacsvrn/github-watchlist
    def create_subscriptions(self, repositories):
        watch_payload = json.dumps({'subscribed': True, 'ignored': False})

        for reponame in repositories:
            logging.info('create subscription: %s' % reponame)
            github.put('repos/%s/subscription' % reponame,
                       self.config,
                       payload=watch_payload)
コード例 #3
0
    def test_put_raises_httperrors(self):
        self.mock_github_request('foo', '["foo"]', method='put', payload='fuhuu',
                                 response_status_code=401)
        self.mocker.replay()

        with self.assertRaises(HTTPError) as cm:
            github.put('foo', StubConfig(), 'fuhuu')

        self.assertEquals('401 Client Error: Unauthorized', str(cm.exception))
コード例 #4
0
 def test_put_request(self):
     self.mock_github_request('foo', '["foo"]', method='put', payload='fuhuu')
     self.mocker.replay()
     github.put('foo', StubConfig(), 'fuhuu')