本文整理汇总了Python中cfme.automate.explorer.domain.DomainCollection.create方法的典型用法代码示例。如果您正苦于以下问题:Python DomainCollection.create方法的具体用法?Python DomainCollection.create怎么用?Python DomainCollection.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cfme.automate.explorer.domain.DomainCollection
的用法示例。
在下文中一共展示了DomainCollection.create方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_duplicate_domain_disallowed
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import create [as 别名]
def test_duplicate_domain_disallowed(request):
domains = DomainCollection()
domain = domains.create(
name=fauxfactory.gen_alpha(),
description=fauxfactory.gen_alpha(),
enabled=True)
request.addfinalizer(domain.delete_if_exists)
with error.expected("Name has already been taken"):
domains.create(
name=domain.name,
description=domain.description,
enabled=domain.enabled)
示例2: domain
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import create [as 别名]
def domain(appliance):
dc = DomainCollection(appliance)
d = dc.create(
name='test_{}'.format(fauxfactory.gen_alpha()),
description='desc_{}'.format(fauxfactory.gen_alpha()),
enabled=True)
yield d
d.delete()
示例3: copy_domain
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import create [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
示例4: test_domain_lock_unlock
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import create [as 别名]
def test_domain_lock_unlock(request):
domains = DomainCollection()
domain = domains.create(
name=fauxfactory.gen_alpha(),
description=fauxfactory.gen_alpha(),
enabled=True)
request.addfinalizer(domain.delete)
ns1 = domain.namespaces.create(name='ns1')
ns2 = ns1.namespaces.create(name='ns2')
cls = ns2.classes.create(name='class1')
cls.schema.add_field(name='myfield', type='Relationship')
inst = cls.instances.create(name='inst')
meth = cls.methods.create(name='meth', script='$evm')
# Lock the domain
domain.lock()
# Check that nothing is editable
# namespaces
details = navigate_to(ns1, 'Details')
assert not details.configuration.is_displayed
details = navigate_to(ns2, 'Details')
assert not details.configuration.is_displayed
# class
details = navigate_to(cls, 'Details')
assert details.configuration.items == ['Copy selected Instances']
assert not details.configuration.item_enabled('Copy selected Instances')
details.schema.select()
assert not details.configuration.is_displayed
# instance
details = navigate_to(inst, 'Details')
assert details.configuration.items == ['Copy this Instance']
# method
details = navigate_to(meth, 'Details')
assert details.configuration.items == ['Copy this Method']
# Unlock it
domain.unlock()
# Check that it is editable
with update(ns1):
ns1.name = 'UpdatedNs1'
assert ns1.exists
with update(ns2):
ns2.name = 'UpdatedNs2'
assert ns2.exists
with update(cls):
cls.name = 'UpdatedClass'
assert cls.exists
cls.schema.add_field(name='myfield2', type='Relationship')
with update(inst):
inst.name = 'UpdatedInstance'
assert inst.exists
with update(meth):
meth.name = 'UpdatedMethod'
assert meth.exists
示例5: create_domain
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import create [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
示例6: test_domain_delete_from_table
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import create [as 别名]
def test_domain_delete_from_table(request):
domains = DomainCollection()
generated = []
for _ in range(3):
domain = domains.create(
name=fauxfactory.gen_alpha(),
description=fauxfactory.gen_alpha(),
enabled=True)
request.addfinalizer(domain.delete_if_exists)
generated.append(domain)
domains.delete(*generated)
for domain in generated:
assert not domain.exists
示例7: test_domain_crud
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import create [as 别名]
def test_domain_crud(request, enabled):
domains = DomainCollection()
domain = domains.create(
name=fauxfactory.gen_alpha(),
description=fauxfactory.gen_alpha(),
enabled=enabled)
request.addfinalizer(domain.delete_if_exists)
assert domain.exists
# TODO: Verify details
updated_description = "editdescription{}".format(fauxfactory.gen_alpha())
with update(domain):
domain.description = updated_description
assert domain.exists
domain.delete(cancel=True)
assert domain.exists
domain.delete()
assert not domain.exists
示例8: test_domain_crud
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import create [as 别名]
def test_domain_crud(request, enabled):
domains = DomainCollection()
domain = domains.create(
name=fauxfactory.gen_alpha(),
description=fauxfactory.gen_alpha(),
enabled=enabled)
request.addfinalizer(domain.delete_if_exists)
assert domain.exists
view = navigate_to(domain, 'Details')
if enabled:
assert 'Disabled' not in view.title.text
else:
assert 'Disabled' in view.title.text
updated_description = "editdescription{}".format(fauxfactory.gen_alpha())
with update(domain):
domain.description = updated_description
view = navigate_to(domain, 'Edit')
assert view.description.value == updated_description
assert domain.exists
domain.delete(cancel=True)
assert domain.exists
domain.delete()
assert not domain.exists
示例9: test_domain_name_wrong
# 需要导入模块: from cfme.automate.explorer.domain import DomainCollection [as 别名]
# 或者: from cfme.automate.explorer.domain.DomainCollection import create [as 别名]
def test_domain_name_wrong():
domains = DomainCollection()
with error.expected('Name may contain only'):
domains.create(name='with space')