当前位置: 首页>>代码示例>>Python>>正文


Python Requester.get_url方法代码示例

本文整理汇总了Python中jenkinsapi.utils.requester.Requester.get_url方法的典型用法代码示例。如果您正苦于以下问题:Python Requester.get_url方法的具体用法?Python Requester.get_url怎么用?Python Requester.get_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jenkinsapi.utils.requester.Requester的用法示例。


在下文中一共展示了Requester.get_url方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_reload

# 需要导入模块: from jenkinsapi.utils.requester import Requester [as 别名]
# 或者: from jenkinsapi.utils.requester.Requester import get_url [as 别名]
 def test_reload(self, _poll):
     mock_requester = Requester(username='foouser', password='foopassword')
     mock_requester.get_url = mock.MagicMock(return_value='')
     J = Jenkins('http://localhost:8080/',
                 username='foouser', password='foopassword',
                 requester=mock_requester)
     J.poll()
开发者ID:AmyLewis,项目名称:jenkinsapi,代码行数:9,代码来源:test_jenkins.py

示例2: test_create_view

# 需要导入模块: from jenkinsapi.utils.requester import Requester [as 别名]
# 或者: from jenkinsapi.utils.requester.Requester import get_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")
开发者ID:Jeff-Meadows,项目名称:jenkinsapi,代码行数:18,代码来源:test_views.py

示例3: test_create_view

# 需要导入模块: from jenkinsapi.utils.requester import Requester [as 别名]
# 或者: from jenkinsapi.utils.requester.Requester import get_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')
开发者ID:aamerine,项目名称:jenkinsapi,代码行数:21,代码来源:test_views.py

示例4: test_get_url

# 需要导入模块: from jenkinsapi.utils.requester import Requester [as 别名]
# 或者: from jenkinsapi.utils.requester.Requester import get_url [as 别名]
 def test_get_url(self, _get):
     _get.return_value = 'SUCCESS'
     req = Requester('foo', 'bar')
     self.assertTrue(req.get_url('http://dummy',
                     params={'param': 'value'},
                     headers=None)=='SUCCESS')
开发者ID:baris,项目名称:jenkinsapi,代码行数:8,代码来源:test_requester.py


注:本文中的jenkinsapi.utils.requester.Requester.get_url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。