當前位置: 首頁>>代碼示例>>Python>>正文


Python DomainCollection.create方法代碼示例

本文整理匯總了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)
開發者ID:rananda,項目名稱:cfme_tests,代碼行數:14,代碼來源:test_domain.py

示例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()
開發者ID:hhovsepy,項目名稱:cfme_tests,代碼行數:10,代碼來源:test_method.py

示例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
開發者ID:niyazRedhat,項目名稱:integration_tests,代碼行數:11,代碼來源:test_add_remove_vm_to_service.py

示例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
開發者ID:dajohnso,項目名稱:cfme_tests,代碼行數:54,代碼來源:test_domain.py

示例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
開發者ID:mkoura,項目名稱:cfme_tests,代碼行數:16,代碼來源:test_service_manual_approval.py

示例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
開發者ID:rananda,項目名稱:cfme_tests,代碼行數:16,代碼來源:test_domain.py

示例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
開發者ID:rananda,項目名稱:cfme_tests,代碼行數:19,代碼來源:test_domain.py

示例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
開發者ID:dajohnso,項目名稱:cfme_tests,代碼行數:25,代碼來源:test_domain.py

示例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')
開發者ID:dajohnso,項目名稱:cfme_tests,代碼行數:6,代碼來源:test_domain.py


注:本文中的cfme.automate.explorer.domain.DomainCollection.create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。