示例#1
0
def test_parse_service_path():
    expected = {
        "project": "whelk",
        "location": "octopus",
        "namespace": "oyster",
        "service": "nudibranch",
    }
    path = LookupServiceClient.service_path(**expected)

    # Check that the path construction is reversible.
    actual = LookupServiceClient.parse_service_path(path)
    assert expected == actual
示例#2
0
def test_service_path():
    project = "scallop"
    location = "abalone"
    namespace = "squid"
    service = "clam"
    expected = "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}".format(
        project=project,
        location=location,
        namespace=namespace,
        service=service,
    )
    actual = LookupServiceClient.service_path(project, location, namespace,
                                              service)
    assert expected == actual