本文整理汇总了Python中pygithub3.tests.utils.services._函数的典型用法代码示例。如果您正苦于以下问题:Python _函数的具体用法?Python _怎么用?Python _使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_LIST_BY_ORG_filters
def test_LIST_BY_ORG_filters(self, request_method):
request_method.return_value = mock_response_result()
self.rs.list_by_org('org_name', type='public').all()
self.assertEqual(request_method.call_args[0],
('get', _('orgs/org_name/repos')))
self.assertEqual(request_method.call_args[1]['params']['type'],
'public')
示例2: test_LIST_COMMITS
def test_LIST_COMMITS(self, reqm):
reqm.return_value = mock_response_result('get')
self.service.list_commits(123).all()
self.assertEqual(
reqm.call_args[0],
('get', _('repos/user/repo/pulls/123/commits'))
)
示例3: test_IS_MERGED
def test_IS_MERGED(self, reqm):
resp = self.service.is_merged(123)
self.assertTrue(resp)
self.assertEqual(
reqm.call_args[0],
('head', _('repos/user/repo/pulls/123/merge'))
)
示例4: test_delete
def test_delete(self, reqm):
reqm.return_value = mock_response('delete')
self.service.delete('branch')
self.assertEqual(
reqm.call_args[0],
('delete', _('repos/user/repo/git/refs/branch'))
)
示例5: test_update
def test_update(self, reqm):
reqm.return_value = mock_response('patch')
self.service.update('master', {'sha': 'abc123'})
self.assertEqual(
reqm.call_args[0],
('patch', _('repos/user/repo/git/refs/master'))
)
示例6: test_create
def test_create(self, reqm):
reqm.return_value = mock_response('post')
self.service.create({'sha': 'hello', 'ref': 'something'})
self.assertEqual(
reqm.call_args[0],
('post', _('repos/user/repo/git/refs'))
)
示例7: test_GET
def test_GET(self, reqm):
reqm.return_value = mock_response()
self.service.get(123)
self.assertEqual(
reqm.call_args[0],
('get', _('repos/user/repo/pulls/123'))
)
示例8: test_MERGE
def test_MERGE(self, reqm):
reqm.return_value = mock_response(200)
self.service.merge(123, 'merging this')
self.assertEqual(
reqm.call_args[0],
('put', _('repos/user/repo/pulls/123/merge'))
)
示例9: test_LIST
def test_LIST(self, reqm):
reqm.return_value = mock_response_result()
self.service.list().all()
self.assertEqual(
reqm.call_args[0],
('get', _('repos/user/repo/pulls'))
)
示例10: test_GET
def test_GET(self, reqm):
reqm.return_value = mock_response()
self.service.get('abc123')
self.assertEqual(
reqm.call_args[0],
('get', _('repos/octocat/repo/git/commits/abc123'))
)
示例11: test_DELETE
def test_DELETE(self, reqm):
reqm.return_value = mock_response(204)
self.service.delete(1)
self.assertEqual(
reqm.call_args[0],
('delete', _('repos/user/repo/pulls/comments/1'))
)
示例12: test_LIST_filters
def test_LIST_filters(self, request_method):
request_method.return_value = mock_response_result()
self.rs.list('octoc', type='public').all()
self.assertEqual(request_method.call_args[0],
('get', _('users/octoc/repos')))
self.assertEqual(request_method.call_args[1]['params']['type'],
'public')
示例13: test_CREATE_comment
def test_CREATE_comment(self, request_method):
request_method.return_value = mock_response('post')
data = dict(body='some', commit_id='e2bc',
line=1, path='some.txt', position=1)
self.cs.create_comment(data, 'e3bc')
self.assertEqual(request_method.call_args[0],
('post', _('repos/oct/re_oct/commits/e3bc/comments')))
示例14: test_WITH_mimetype
def test_WITH_mimetype(self, request_method):
request_method.return_value = mock_response()
self.ms.set_html()
self.ms.dummy_request()
request_method.assert_called_with('get', _('dummyrequest'),
headers={'Accept': 'application/vnd.github.%s.html+json' %
MimeTypeMixin.VERSION},
params={})
示例15: test_CREATE
def test_CREATE(self, reqm):
reqm.return_value = mock_response('post')
self.service.create({'tag': 'v1.2.3', 'message': 'a tag',
'object': 'abc123', 'type': 'commit'})
self.assertEqual(
reqm.call_args[0],
('post', _('repos/user/repo/git/tags'))
)