Ejemplo n.º 1
0
def test_product_path():
    project = "squid"
    location = "clam"
    product = "whelk"

    expected = "projects/{project}/locations/{location}/products/{product}".format(
        project=project, location=location, product=product,
    )
    actual = ImageAnnotatorClient.product_path(project, location, product)
    assert expected == actual
Ejemplo n.º 2
0
def test_parse_product_path():
    expected = {
        "project": "octopus",
        "location": "oyster",
        "product": "nudibranch",
    }
    path = ImageAnnotatorClient.product_path(**expected)

    # Check that the path construction is reversible.
    actual = ImageAnnotatorClient.parse_product_path(path)
    assert expected == actual