Exemple #1
0
def test_create_product(capsys):
    create_product(
        PROJECT_ID, LOCATION, PRODUCT_ID,
        PRODUCT_DISPLAY_NAME, PRODUCT_CATEGORY)
    list_products(PROJECT_ID, LOCATION)
    out, _ = capsys.readouterr()
    assert PRODUCT_ID in out
Exemple #2
0
def product():
    # set up
    create_product(PROJECT_ID, LOCATION, PRODUCT_ID, PRODUCT_DISPLAY_NAME,
                   PRODUCT_CATEGORY)

    yield None

    # tear down
    delete_product(PROJECT_ID, LOCATION, PRODUCT_ID)
def product():
    # set up
    create_product(
        PROJECT_ID, LOCATION, PRODUCT_ID,
        PRODUCT_DISPLAY_NAME, PRODUCT_CATEGORY)

    yield None

    # tear down
    delete_product(PROJECT_ID, LOCATION, PRODUCT_ID)
def setup_teardown():
    # set up
    create_product_set(PROJECT_ID, LOCATION, PRODUCT_SET_ID,
                       PRODUCT_SET_DISPLAY_NAME)
    create_product(PROJECT_ID, LOCATION, PRODUCT_ID, PRODUCT_DISPLAY_NAME,
                   PRODUCT_CATEGORY)

    yield

    # tear down
    delete_product(PROJECT_ID, LOCATION, PRODUCT_ID)
    delete_product_set(PROJECT_ID, LOCATION, PRODUCT_SET_ID)
def test_create_product(capsys):
    list_products(PROJECT_ID, LOCATION)
    out, _ = capsys.readouterr()
    assert PRODUCT_ID not in out

    create_product(
        PROJECT_ID, LOCATION, PRODUCT_ID,
        PRODUCT_DISPLAY_NAME, PRODUCT_CATEGORY)
    list_products(PROJECT_ID, LOCATION)
    out, _ = capsys.readouterr()
    assert PRODUCT_ID in out

    delete_product(PROJECT_ID, LOCATION, PRODUCT_ID)
Exemple #6
0
def test_resources():
    # set up
    product_set_id = f'test_set_{uuid.uuid4()}'
    product_id = f'test_product_{uuid.uuid4()}'
    create_product_set(PROJECT_ID, LOCATION, product_set_id,
                       PRODUCT_SET_DISPLAY_NAME)
    create_product(PROJECT_ID, LOCATION, product_id, PRODUCT_DISPLAY_NAME,
                   PRODUCT_CATEGORY)

    yield product_set_id, product_id

    # tear down
    delete_product(PROJECT_ID, LOCATION, product_id)
    delete_product_set(PROJECT_ID, LOCATION, product_set_id)