本文整理汇总了Python中cfme.services.catalogs.catalog.Catalog类的典型用法代码示例。如果您正苦于以下问题:Python Catalog类的具体用法?Python Catalog怎么用?Python Catalog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Catalog类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_broken_angular_select
def test_broken_angular_select(request):
"""Test that checks the fancy selects do not break.
Prerequisities:
* A fresh downstream appliance
Steps:
1) Create a catalog.
2) Create a catalog item, can be Generic and assign the catalog and OSE Installer dialog
for testing purposes
3) Try ordering the service, but instead of confirming the form, try changing some select.
"""
# OSE Installer dialog, one dropdown from it
the_select = AngularSelect("ose_size")
cat = Catalog("Test_catalog_{}".format(fauxfactory.gen_alpha()))
cat.create()
request.addfinalizer(cat.delete)
item = CatalogItem(
item_type="Generic",
name="Catitem_{}".format(fauxfactory.gen_alpha()),
description=fauxfactory.gen_alpha(),
display_in=True,
catalog=cat.name,
dialog="OSE Installer")
item.create()
request.addfinalizer(item.delete)
# The check itself
pytest.sel.force_navigate(
"order_service_catalog",
context={"catalog": cat.name, "catalog_item": item})
fill(the_select, "Medium")
assert not the_select.is_broken, "The select displayed itself next ot the angular select"
示例2: catalog
def catalog(request):
catalog = "cat_" + fauxfactory.gen_alphanumeric()
cat = Catalog(name=catalog,
description="my catalog")
cat.create()
request.addfinalizer(cat.delete)
yield catalog
示例3: test_broken_angular_select
def test_broken_angular_select(request):
"""Test that checks the fancy selects do not break.
Prerequisities:
* A fresh downstream appliance
Steps:
1) Create a catalog.
2) Create a catalog item, can be Generic and assign the catalog and OSE Installer dialog
for testing purposes
3) Try ordering the service, but instead of confirming the form, try changing some select.
"""
# OSE Installer dialog, one dropdown from it
the_select = AngularSelect("param_operatingSystemType")
cat = Catalog("Test_catalog_{}".format(fauxfactory.gen_alpha()))
cat.create()
request.addfinalizer(cat.delete)
item = CatalogItem(
item_type="Generic",
name="Catitem_{}".format(fauxfactory.gen_alpha()),
description=fauxfactory.gen_alpha(),
display_in=True,
catalog=cat.name,
dialog="azure-single-vm-from-user-image")
item.create()
request.addfinalizer(item.delete)
sc = service_catalogs.ServiceCatalogs(item.name)
navigate_to(sc, 'Order')
# The check itself
fill(the_select, "Linux")
assert not the_select.is_broken, "The select displayed itself next ot the angular select"
示例4: catalog
def catalog():
cat_name = "cat_{}".format(fauxfactory.gen_alphanumeric())
catalog = Catalog(name=cat_name, description="my catalog")
catalog.create()
yield catalog
if catalog.exists:
catalog.delete()
示例5: catalog
def catalog(ansible_catalog_item):
catalog_ = Catalog(fauxfactory.gen_alphanumeric(), items=[ansible_catalog_item.name])
catalog_.create()
ansible_catalog_item.catalog = catalog_
yield catalog_
if catalog_.exists:
catalog_.delete()
ansible_catalog_item.catalog = None
示例6: catalog
def catalog():
catalog = "cat_" + fauxfactory.gen_alphanumeric()
cat = Catalog(name=catalog, description="my catalog")
try:
cat.create()
yield cat
finally:
if cat.exists:
cat.delete()
示例7: catalog
def catalog():
catalog_name = "test_cat_" + fauxfactory.gen_alphanumeric()
cat = Catalog(name=catalog_name,
description="my catalog")
cat.create()
yield cat
# fixture cleanup
try:
cat.delete()
except NoSuchElementException:
logger.warning('test_catalog_item: catalog yield fixture cleanup, catalog "{}" not '
'found'.format(catalog_name))
示例8: test_permissions_catalog_add
def test_permissions_catalog_add(appliance):
""" Tests that a catalog can be added only with the right permissions"""
cat = Catalog(name=fauxfactory.gen_alphanumeric(),
description="my catalog")
test_product_features = [['Everything', 'Services', 'Catalogs Explorer', 'Catalogs']]
# Since we try to create the catalog with the same name, we obliged to delete it after creation
# in order to avoid "Name has already been taken" error which makes this test "blind" to the
# fact, that disallowed action actually can be performed.
# TODO: remove this workaround with "lambda"
test_actions = {'Add Catalog': lambda _: cat.create(),
'Delete Catalog': lambda _: cat.delete()}
tac.single_task_permission_test(appliance, test_product_features, test_actions)
示例9: test_catalog_duplicate_name
def test_catalog_duplicate_name():
cat = Catalog(name=fauxfactory.gen_alphanumeric(),
description="my catalog")
cat.create()
with error.expected("Name has already been taken"):
cat.create()
cat.delete()
示例10: test_catalog_duplicate_name
def test_catalog_duplicate_name():
cat = Catalog(name=rand.generate_random_string(),
description="my catalog")
cat.create()
with error.expected("Name has already been taken"):
cat.create()
cat.delete()
示例11: test_catalog_crud
def test_catalog_crud():
cat = Catalog(name=fauxfactory.gen_alphanumeric(),
description="my catalog")
cat.create()
with update(cat):
cat.description = "my edited description"
cat.delete()
示例12: test_catalog_crud
def test_catalog_crud():
cat = Catalog(name=rand.generate_random_string(),
description="my catalog")
cat.create()
with update(cat):
cat.description = "my edited description"
cat.delete()
示例13: catalog
def catalog():
catalog = "cat_" + fauxfactory.gen_alphanumeric()
cat = Catalog(name=catalog,
description="my catalog")
cat.create()
yield catalog
示例14: catalog
def catalog():
catalog = "cat_" + generate_random_string()
cat = Catalog(name=catalog,
description="my catalog")
cat.create()
yield catalog