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)
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))
def test_put_request(self): self.mock_github_request('foo', '["foo"]', method='put', payload='fuhuu') self.mocker.replay() github.put('foo', StubConfig(), 'fuhuu')