示例#1
0
def test_common_location_path():
    project = "winkle"
    location = "nautilus"
    expected = "projects/{project}/locations/{location}".format(
        project=project, location=location,
    )
    actual = ImageAnnotatorClient.common_location_path(project, location)
    assert expected == actual
def test_parse_common_location_path():
    expected = {
        "project": "scallop",
        "location": "abalone",
    }
    path = ImageAnnotatorClient.common_location_path(**expected)

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