本文整理汇总了Python中cfme.automate.explorer.domain.DomainCollection.instantiate方法的典型用法代码示例。如果您正苦于以下问题:Python DomainCollection.instantiate方法的具体用法?Python DomainCollection.instantiate怎么用?Python DomainCollection.instantiate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cfme.automate.explorer.domain.DomainCollection
的用法示例。
在下文中一共展示了DomainCollection.instantiate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: copy_domain
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import instantiate [as 别名]
def copy_domain(request, appliance):
dc = DomainCollection(appliance)
domain = dc.create(name=fauxfactory.gen_alphanumeric(), enabled=True)
request.addfinalizer(domain.delete_if_exists)
dc.instantiate(name='ManageIQ')\
.namespaces.instantiate(name='System')\
.classes.instantiate(name='Request')\
.copy_to(domain)
return domain
示例2: test_domain_cannot_edit_builtin
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import instantiate [as 别名]
def test_domain_cannot_edit_builtin():
domains = DomainCollection()
manageiq_domain = domains.instantiate(name='ManageIQ')
details_view = navigate_to(manageiq_domain, 'Details')
if domains.appliance.version < '5.7':
assert details_view.configuration.is_displayed
assert not details_view.configuration.item_enabled('Edit this Domain')
else:
assert not details_view.configuration.is_displayed
示例3: create_domain
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import instantiate [as 别名]
def create_domain(request, appliance):
"""Create new domain and copy instance from ManageIQ to this domain"""
dc = DomainCollection(appliance)
new_domain = dc.create(name=fauxfactory.gen_alphanumeric(), enabled=True)
request.addfinalizer(new_domain.delete_if_exists)
instance = (dc.instantiate(name='ManageIQ')
.namespaces.instantiate(name='Service')
.namespaces.instantiate(name='Provisioning')
.namespaces.instantiate(name='StateMachines')
.classes.instantiate(name='ServiceProvisionRequestApproval')
.instances.instantiate(name='Default'))
instance.copy_to(new_domain)
return new_domain
示例4: import_domain_from
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import instantiate [as 别名]
def import_domain_from(self, branch=None, tag=None):
"""Import the domain from git using the Import/Export UI.
Args:
branch: If you import from a branch, specify the origin/branchname
tag: If you import from a tag, specify its name.
Returns:
Instance of :py:class:`cfme.automate.explorer.domain.Domain`
**Important!** ``branch`` and ``tag`` are mutually exclusive.
"""
imex_page = navigate_to(self.appliance.server, 'AutomateImportExport')
assert imex_page.import_git.fill(self.fill_values_repo_add)
imex_page.import_git.submit.click()
imex_page.browser.plugin.ensure_page_safe(timeout='5m')
git_select = self.create_view(GitImportSelectorView)
assert git_select.is_displayed
git_select.flash.assert_no_error()
assert git_select.fill(self.fill_values_branch_select(branch, tag))
git_select.submit.click()
git_select.browser.plugin.ensure_page_safe(timeout='5m')
imex_page = self.create_view(AutomateImportExportView)
assert imex_page.is_displayed
imex_page.flash.assert_no_error()
# Now find the domain in database
namespaces = self.appliance.db.client['miq_ae_namespaces']
git_repositories = self.appliance.db.client['git_repositories']
none = None
query = self.appliance.db.client.session\
.query(
namespaces.id, namespaces.name, namespaces.description, git_repositories.url,
namespaces.ref_type, namespaces.ref)\
.filter(namespaces.parent_id == none, namespaces.source == 'remote')\
.join(git_repositories, namespaces.git_repository_id == git_repositories.id)
for id, name, description, url, git_type, git_type_value in query:
if url != self.url:
continue
if not (
git_type == 'branch' and branch == git_type_value or
git_type == 'tag' and tag == git_type_value):
continue
# We have the domain
from cfme.automate.explorer.domain import DomainCollection
dc = DomainCollection(appliance=self.appliance)
return dc.instantiate(
db_id=id, name=name, description=description, git_checkout_type=git_type,
git_checkout_value=git_type_value)
else:
raise ValueError('The domain imported was not found in the database!')
示例5: test_domain_present
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import instantiate [as 别名]
def test_domain_present(domain_name, soft_assert):
"""This test verifies presence of domains that are included in the appliance.
Prerequisities:
* Clean appliance.
Steps:
* Open the Automate Explorer.
* Verify that all of the required domains are present.
"""
dc = DomainCollection()
domain = dc.instantiate(name=domain_name)
soft_assert(domain.exists, "Domain {} does not exist!".format(domain_name))
soft_assert(domain.locked, "Domain {} is not locked!".format(domain_name))
soft_assert(
dbq.check_domain_enabled(domain_name), "Domain {} is not enabled!".format(domain_name))
示例6: test_domain_present
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import instantiate [as 别名]
def test_domain_present(domain_name, soft_assert, appliance):
"""This test verifies presence of domains that are included in the appliance.
Prerequisities:
* Clean appliance.
Steps:
* Open the Automate Explorer.
* Verify that all of the required domains are present.
Polarion:
assignee: dmisharo
casecomponent: Automate
caseimportance: critical
initialEstimate: 1/60h
testtype: functional
"""
dc = DomainCollection(appliance)
domain = dc.instantiate(name=domain_name)
soft_assert(domain.exists, "Domain {} does not exist!".format(domain_name))
soft_assert(domain.locked, "Domain {} is not locked!".format(domain_name))
soft_assert(
appliance.check_domain_enabled(
domain_name), "Domain {} is not enabled!".format(domain_name))