本文整理汇总了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
示例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
示例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.")
示例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)
示例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
示例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
示例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)
示例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
示例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