def test_update_enterprise_success(debug):
responses.add(
responses.GET,
'http://dummy.url/repos/foo/bar/commits?access_token=foobar',
json=[{'commit': {
'author': {'name': 'alice'},
'committer': {'name': 'bob', 'date': TWO_DAYS_AGO},
'message': 'commit message',
}}],
)
service = GitHubEnterprise(api_token='foobar', account='foo', repo='bar',
root='http://dummy.url')
result = service.update()
debug.assert_called_once_with('fetching GitHub project data')
assert result == {'commits': [{
'message': 'commit message',
'author': 'alice [bob]',
'committed': 'two days ago'
}], 'name': 'foo/bar'}
assert responses.calls[0].request.headers['User-Agent'] == 'bar'
评论列表
文章目录