Exemplo n.º 1
0
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()
Exemplo n.º 2
0
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()
Exemplo n.º 3
0
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()
Exemplo n.º 4
0
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()
Exemplo n.º 5
0
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()
Exemplo n.º 6
0
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()
Exemplo n.º 7
0
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()
Exemplo n.º 8
0
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()
Exemplo n.º 9
0
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()
Exemplo n.º 10
0
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()
def catalog():
    catalog = "cat_" + fauxfactory.gen_alphanumeric()
    cat = Catalog(name=catalog, description="my catalog")
    try:
        cat.create()
        yield catalog
    finally:
        cat.delete()
def catalog(ansible_catalog_item):
    catalog_ = Catalog(fauxfactory.gen_alphanumeric(),
                       items=[ansible_catalog_item.name])
    catalog_.create()
    ansible_catalog_item.catalog = catalog_
    yield catalog_
    catalog_.delete()
    ansible_catalog_item.catalog = None
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
Exemplo n.º 14
0
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()
Exemplo n.º 15
0
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))
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))
Exemplo n.º 17
0
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)
Exemplo n.º 18
0
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)
def catalog():
    cat_name = "cat_" + fauxfactory.gen_alphanumeric()
    catalog = Catalog(name=cat_name, description="my catalog")
    catalog.create()
    yield catalog
    catalog.delete()
Exemplo n.º 20
0
def catalog():
    cat_name = "cat_" + fauxfactory.gen_alphanumeric()
    catalog = Catalog(name=cat_name, description="my catalog")
    catalog.create()
    yield catalog
    catalog.delete()