本文整理汇总了Python中pygithub3.tests.utils.base.mock_response_result函数的典型用法代码示例。如果您正苦于以下问题:Python mock_response_result函数的具体用法?Python mock_response_result怎么用?Python mock_response_result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mock_response_result函数的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
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'))
)
示例3: 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')
示例4: 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'))
)
示例5: test_GET
def test_GET(self, request_method):
request_method.return_value = mock_response_result()
self.ts.get(1)
self.assertEqual(request_method.call_args[0], ('get', _('teams/1')))
示例6: test_LIST_by_issue
def test_LIST_by_issue(self, request_method):
request_method.return_value = mock_response_result()
self.ev.list_by_issue(1).all()
self.assertEqual(request_method.call_args[0],
('get', _('repos/octocat/Hello-World/issues/1/events')))
示例7: test_REMOVE_TEAM_REPO
def test_REMOVE_TEAM_REPO(self, request_method):
request_method.return_value = mock_response_result('delete')
self.ts.remove_repo(1, 'octocat', 're_oct')
self.assertEqual(request_method.call_args[0],
('delete', _('teams/1/repos/octocat/re_oct')))
示例8: test_CONTAINS_REPO
def test_CONTAINS_REPO(self, request_method):
request_method.return_value = mock_response_result()
self.ts.contains_repo(1, 'octocat', 're_oct')
self.assertEqual(request_method.call_args[0],
('head', _('teams/1/repos/octocat/re_oct')))
示例9: test_REMOVE_MEMBER
def test_REMOVE_MEMBER(self, request_method):
request_method.return_value = mock_response_result('delete')
self.ts.remove_member(1, 'octocat')
self.assertEqual(request_method.call_args[0],
('delete', _('teams/1/members/octocat')))
示例10: test_DELETE
def test_DELETE(self, request_method):
request_method.return_value = mock_response_result('delete')
self.ts.delete(1)
self.assertEqual(request_method.call_args[0], ('delete', _('teams/1')))
示例11: test_LIST_without_user
def test_LIST_without_user(self, request_method):
request_method.return_value = mock_response_result()
self.rs.set_user('')
self.rs.list().all()
self.assertEqual(request_method.call_args[0], ('get', _('user/repos')))
示例12: test_LIST
def test_LIST(self, request_method):
request_method.return_value = mock_response_result()
self.cs.list().all()
self.assertEqual(request_method.call_args[0],
('get', _('repos/octocat/oc_repo/collaborators')))
示例13: test_LIST_comments_for_commit
def test_LIST_comments_for_commit(self, request_method):
request_method.return_value = mock_response_result()
self.cs.list_comments(sha='e3bc').all()
self.assertEqual(request_method.call_args[0],
('get', _('repos/oct/re_oct/commits/e3bc/comments')))
示例14: test_LIST_branches
def test_LIST_branches(self, request_method):
request_method.return_value = mock_response_result()
self.rs.list_branches().all()
self.assertEqual(request_method.call_args[0],
('get', _('repos/octocat/octocat_repo/branches')))
示例15: test_LIST_contributors_with_anonymous
def test_LIST_contributors_with_anonymous(self, request_method):
request_method.return_value = mock_response_result()
self.rs.list_contributors_with_anonymous().all()
self.assertEqual(request_method.call_args[0],
('get', _('repos/octocat/octocat_repo/contributors')))
self.assertEqual(request_method.call_args[1]['params']['anom'], True)