本文整理汇总了Python中pygithub3.tests.utils.base.mock_response函数的典型用法代码示例。如果您正苦于以下问题:Python mock_response函数的具体用法?Python mock_response怎么用?Python mock_response使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mock_response函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: 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')))
开发者ID:5783354,项目名称:python-github3,代码行数:7,代码来源:test_repos.py
示例2: 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'))
)
开发者ID:KWMalik,项目名称:python-github3,代码行数:7,代码来源:test_git_data.py
示例3: 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'))
)
开发者ID:KWMalik,项目名称:python-github3,代码行数:7,代码来源:test_pull_requests.py
示例4: 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'))
)
开发者ID:KWMalik,项目名称:python-github3,代码行数:7,代码来源:test_git_data.py
示例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'))
)
开发者ID:KWMalik,项目名称:python-github3,代码行数:7,代码来源:test_git_data.py
示例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'))
)
开发者ID:KWMalik,项目名称:python-github3,代码行数:7,代码来源:test_git_data.py
示例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'))
)
开发者ID:KWMalik,项目名称:python-github3,代码行数:7,代码来源:test_pull_requests.py
示例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'))
)
开发者ID:KWMalik,项目名称:python-github3,代码行数:7,代码来源:test_pull_requests.py
示例9: test_CREATE
def test_CREATE(self, request_method):
request_method.return_value = mock_response('post')
self.ss.create({"state": "success",
"target_url": "https://example.com/build/status",
"description": "The build succeeded!"},
sha='e3bc')
self.assertEqual(request_method.call_args[0],
('post', _('repos/oct/re_oct/statuses/e3bc')))
开发者ID:shanereid,项目名称:python-github3,代码行数:8,代码来源:test_repos.py
示例10: 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={})
开发者ID:agargiulo,项目名称:python-github3,代码行数:8,代码来源:test_core.py
示例11: test_UPDATE
def test_UPDATE(self, reqm):
reqm.return_value = mock_response('patch')
data = {}
self.service.update(123, data)
self.assertEqual(
reqm.call_args[0],
('patch', _('repos/user/repo/pulls/123'))
)
开发者ID:KWMalik,项目名称:python-github3,代码行数:8,代码来源:test_pull_requests.py
示例12: 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'))
)
开发者ID:KWMalik,项目名称:python-github3,代码行数:8,代码来源:test_git_data.py
示例13: test_CREATE_with_no_title
def test_CREATE_with_no_title(self, reqm):
reqm.return_value = mock_response('post')
data = {
'body': 'merge me!',
'head': 'octocat:some-feature',
'base': 'master',
}
self.service.create(data)
开发者ID:KWMalik,项目名称:python-github3,代码行数:8,代码来源:test_pull_requests.py
示例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={},
)
开发者ID:ad-m,项目名称:python-github3,代码行数:10,代码来源:test_core.py
示例15: test_CREATE_in_reply_to
def test_CREATE_in_reply_to(self, reqm):
reqm.return_value = mock_response(201)
data = {
'body': ':sparkles:',
'in_reply_to': '5',
}
self.service.create(1, data)
self.assertEqual(
reqm.call_args[0],
('post', _('repos/user/repo/pulls/1/comments'))
)
开发者ID:KWMalik,项目名称:python-github3,代码行数:11,代码来源:test_pull_requests.py
示例16: test_CREATE_with_issue
def test_CREATE_with_issue(self, reqm):
reqm.return_value = mock_response('post')
data = {
'issue': 1,
'head': 'octocat:some-feature',
'base': 'master',
}
self.service.create(data)
self.assertEqual(
reqm.call_args[0],
('post', _('repos/user/repo/pulls'))
)
开发者ID:KWMalik,项目名称:python-github3,代码行数:12,代码来源:test_pull_requests.py
示例17: test_CREATE_with_title_and_body
def test_CREATE_with_title_and_body(self, reqm):
reqm.return_value = mock_response('post')
data = {
'title': 'this is a pull request',
'body': 'merge me!',
'head': 'octocat:some-feature',
'base': 'master',
}
self.service.create(data)
self.assertEqual(
reqm.call_args[0],
('post', _('repos/user/repo/pulls'))
)
开发者ID:KWMalik,项目名称:python-github3,代码行数:13,代码来源:test_pull_requests.py
示例18: test_DELEGATES_methods
def test_DELEGATES_methods(self, request_method):
request_method.return_value = mock_response()
self.c.get('')
request_method.assert_called_with('get', '')
request_method.return_value = mock_response('post')
self.c.post('')
request_method.assert_called_with('post', '')
request_method.return_value = mock_response('patch')
self.c.patch('')
request_method.assert_called_with('patch', '')
self.c.put('')
request_method.assert_called_with('put', '')
request_method.return_value = mock_response('delete')
self.c.delete('')
request_method.assert_called_with('delete', '')
self.c.head('')
request_method.assert_called_with('head', '')
开发者ID:5783354,项目名称:python-github3,代码行数:22,代码来源:test_client.py
示例19: test_CREATE
def test_CREATE(self, reqm):
reqm.return_value = mock_response(201)
data = {
'body': ':sparkles:',
'commit_id': 'abc123',
'path': 'foo.txt',
'position': '2',
}
self.service.create(1, data)
self.assertEqual(
reqm.call_args[0],
('post', _('repos/user/repo/pulls/1/comments'))
)
开发者ID:KWMalik,项目名称:python-github3,代码行数:13,代码来源:test_pull_requests.py
示例20: test_PUBLICIZE_MEMBERSHIP
def test_PUBLICIZE_MEMBERSHIP(self, request_method):
request_method.return_value = mock_response()
self.ms.publicize_membership('acme', 'octocat')
self.assertEqual(request_method.call_args[0],
('put', _('orgs/acme/public_members/octocat')))
开发者ID:5783354,项目名称:python-github3,代码行数:5,代码来源:test_orgs.py
注:本文中的pygithub3.tests.utils.base.mock_response函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论