本文整理汇总了Python中jenkinsapi.utils.requester.Requester.post_url方法的典型用法代码示例。如果您正苦于以下问题:Python Requester.post_url方法的具体用法?Python Requester.post_url怎么用?Python Requester.post_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jenkinsapi.utils.requester.Requester
的用法示例。
在下文中一共展示了Requester.post_url方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_create_view
# 需要导入模块: from jenkinsapi.utils.requester import Requester [as 别名]
# 或者: from jenkinsapi.utils.requester.Requester import post_url [as 别名]
def test_create_view(self, _poll, _base_poll):
mock_requester = Requester(username="foouser", password="foopassword")
mock_requester.get_url = mock.MagicMock(return_value="<div/>")
mock_requester.post_url = mock.MagicMock(return_value="")
_poll.return_value = {
"views": [
{"name": "All", "url": "http://localhost:8080/views/All"},
{"name": "NewView", "url": "http://localhost:8080/views/NewView"},
]
}
_base_poll.return_value = _poll.return_value
J = Jenkins("http://localhost:8080/", username="foouser", password="foopassword", requester=mock_requester)
new_view = J.views.create("NewView")
self.assertTrue(isinstance(new_view, View))
self.assertEquals(new_view.baseurl, "http://localhost:8080/views/NewView")
示例2: test_create_view
# 需要导入模块: from jenkinsapi.utils.requester import Requester [as 别名]
# 或者: from jenkinsapi.utils.requester.Requester import post_url [as 别名]
def test_create_view(self, _poll, _base_poll):
mock_requester = Requester(username='foouser', password='foopassword')
mock_requester.get_url = mock.MagicMock(return_value='<div/>')
mock_requester.post_url = mock.MagicMock(return_value='')
_poll.return_value = {'views': [
{'name': 'All',
'url': 'http://localhost:8080/views/All'},
{'name': 'NewView',
'url': 'http://localhost:8080/views/NewView'},
]}
_base_poll.return_value = _poll.return_value
J = Jenkins('http://localhost:8080/',
username='foouser', password='foopassword',
requester=mock_requester)
new_view = J.views.create('NewView')
self.assertTrue(isinstance(new_view, View))
self.assertEquals(new_view.baseurl,
'http://localhost:8080/views/NewView')
示例3: test_get_url
# 需要导入模块: from jenkinsapi.utils.requester import Requester [as 别名]
# 或者: from jenkinsapi.utils.requester.Requester import post_url [as 别名]
def test_get_url(self, _post):
_post.return_value = 'SUCCESS'
req = Requester('foo', 'bar')
self.assertTrue(req.post_url('http://dummy',
params={'param': 'value'},
headers=None)=='SUCCESS')