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


Python Jenkins.find_view方法代码示例

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


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

示例1: test_rename_view

# 需要导入模块: from pyjen.jenkins import Jenkins [as 别名]
# 或者: from pyjen.jenkins.Jenkins import find_view [as 别名]
def test_rename_view(jenkins_env):
    jk = Jenkins(jenkins_env["url"], (jenkins_env["admin_user"], jenkins_env["admin_token"]))
    original_view_name = "test_rename_view"
    v = jk.create_view(original_view_name, SectionedView)
    try:
        expected_section_name = "MyNewSection"
        v.add_section("hudson.plugins.sectioned_view.TextSection", expected_section_name)

        expected_view_name = "test_rename_view2"
        v.rename(expected_view_name)
        assert jk.find_view(original_view_name) is None
    finally:
        tmp = jk.find_view(original_view_name)
        if tmp:
            tmp.delete()

    with clean_view(v):
        assert v.name == expected_view_name

        tmp_view = jk.find_view(expected_view_name)
        assert tmp_view is not None
        assert tmp_view.name == expected_view_name

        result = tmp_view.sections

        assert result is not None
        assert isinstance(result, list)
        assert len(result) == 1
        assert result[0].name == expected_section_name
开发者ID:TheFriendlyCoder,项目名称:pyjen,代码行数:31,代码来源:test_sectioned_view.py

示例2: test_find_view

# 需要导入模块: from pyjen.jenkins import Jenkins [as 别名]
# 或者: from pyjen.jenkins.Jenkins import find_view [as 别名]
def test_find_view(jenkins_env):
    jk = Jenkins(jenkins_env["url"], (jenkins_env["admin_user"], jenkins_env["admin_token"]))
    expected_name = "all"
    v = jk.find_view(expected_name)

    assert v is not None
    assert v.name == expected_name
开发者ID:TheFriendlyCoder,项目名称:pyjen,代码行数:9,代码来源:test_jenkins.py

示例3: test_find_missing_view

# 需要导入模块: from pyjen.jenkins import Jenkins [as 别名]
# 或者: from pyjen.jenkins.Jenkins import find_view [as 别名]
 def test_find_missing_view(self):
     # test logic
     j = Jenkins(self.mock_jenkins_data_io)
     View = j.find_view("DoesNotExist")
 
     # verification
     self.assertEqual(View, None, "No valid view should have been found.")
开发者ID:,项目名称:,代码行数:9,代码来源:

示例4: test_find_view_primary_view

# 需要导入模块: from pyjen.jenkins import Jenkins [as 别名]
# 或者: from pyjen.jenkins.Jenkins import find_view [as 别名]
 def test_find_view_primary_view(self):        
     # test logic
     j = Jenkins(self.mock_jenkins_data_io)
     View = j.find_view(self.primary_view_name)
     
     # verification
     self.assertNotEqual(View, None, "code should return a valid pyjen.view object")
     self.assertEqual(View.name, self.primary_view_name, "incorrect view returned by jenkins object")
     self.mock_jenkins_data_io.clone.assert_called_once_with(self.primary_view_url)
开发者ID:,项目名称:,代码行数:11,代码来源:

示例5: test_rename_view

# 需要导入模块: from pyjen.jenkins import Jenkins [as 别名]
# 或者: from pyjen.jenkins.Jenkins import find_view [as 别名]
def test_rename_view(jenkins_env):
    jk = Jenkins(jenkins_env["url"], (jenkins_env["admin_user"], jenkins_env["admin_token"]))
    original_view_name = "test_rename_view1"
    vw = jk.create_view(original_view_name, ListView)
    try:
        expected_name = "test_rename_view2"
        vw.rename(expected_name)
        assert jk.find_view(original_view_name) is None
    finally:
        tmp = jk.find_view(original_view_name)
        if tmp:
            tmp.delete()

    with clean_view(vw):
        assert vw.name == expected_name

        tmp_view = jk.find_view(expected_name)
        assert tmp_view is not None
        assert tmp_view.name == expected_name
开发者ID:TheFriendlyCoder,项目名称:pyjen,代码行数:21,代码来源:test_view.py

示例6: test_clone_view

# 需要导入模块: from pyjen.jenkins import Jenkins [as 别名]
# 或者: from pyjen.jenkins.Jenkins import find_view [as 别名]
def test_clone_view(jenkins_env):
    jk = Jenkins(jenkins_env["url"], (jenkins_env["admin_user"], jenkins_env["admin_token"]))
    original_view_name = "test_clone_view"
    vw1 = jk.create_view(original_view_name, SectionedView)

    with clean_view(vw1):
        expected_section_name = "MyNewSection"
        vw1.add_section("hudson.plugins.sectioned_view.TextSection", expected_section_name)

        expected_view_name = "test_clone_view2"
        vw2 = vw1.clone(expected_view_name)
        assert vw2 is not None
        with clean_view(vw2):

            tmp_view = jk.find_view(expected_view_name)
            assert tmp_view is not None
            assert tmp_view.name == expected_view_name

            result = tmp_view.sections

            assert result is not None
            assert isinstance(result, list)
            assert len(result) == 1
            assert result[0].name == expected_section_name
开发者ID:TheFriendlyCoder,项目名称:pyjen,代码行数:26,代码来源:test_sectioned_view.py

示例7: test_find_view

# 需要导入模块: from pyjen.jenkins import Jenkins [as 别名]
# 或者: from pyjen.jenkins.Jenkins import find_view [as 别名]
def test_find_view(jenkins_env):
    jk = Jenkins(jenkins_env["url"], (jenkins_env["admin_user"], jenkins_env["admin_token"]))
    expected_name = "all"
    v = jk.find_view(expected_name)

    assert isinstance(v, AllView)
开发者ID:TheFriendlyCoder,项目名称:pyjen,代码行数:8,代码来源:test_all_view.py

示例8: test_delete_view

# 需要导入模块: from pyjen.jenkins import Jenkins [as 别名]
# 或者: from pyjen.jenkins.Jenkins import find_view [as 别名]
def test_delete_view(jenkins_env):
    jk = Jenkins(jenkins_env["url"], (jenkins_env["admin_user"], jenkins_env["admin_token"]))
    expected_view_name = "test_delete_view"
    vw = jk.create_view(expected_view_name, ListView)
    vw.delete()
    assert jk.find_view(expected_view_name) is None
开发者ID:TheFriendlyCoder,项目名称:pyjen,代码行数:8,代码来源:test_view.py

示例9: test_find_missing_view

# 需要导入模块: from pyjen.jenkins import Jenkins [as 别名]
# 或者: from pyjen.jenkins.Jenkins import find_view [as 别名]
def test_find_missing_view(jenkins_env):
    jk = Jenkins(jenkins_env["url"], (jenkins_env["admin_user"], jenkins_env["admin_token"]))
    v = jk.find_view("DoesNotExist")

    assert v is None
开发者ID:TheFriendlyCoder,项目名称:pyjen,代码行数:7,代码来源:test_jenkins.py


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