Esempio n. 1
0
def test_parse_endpoint_path():
    expected = {
        "project": "nudibranch",
        "location": "cuttlefish",
        "namespace": "mussel",
        "service": "winkle",
        "endpoint": "nautilus",
    }
    path = LookupServiceClient.endpoint_path(**expected)

    # Check that the path construction is reversible.
    actual = LookupServiceClient.parse_endpoint_path(path)
    assert expected == actual
Esempio n. 2
0
def test_endpoint_path():
    project = "squid"
    location = "clam"
    namespace = "whelk"
    service = "octopus"
    endpoint = "oyster"
    expected = "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}".format(
        project=project,
        location=location,
        namespace=namespace,
        service=service,
        endpoint=endpoint,
    )
    actual = LookupServiceClient.endpoint_path(project, location, namespace,
                                               service, endpoint)
    assert expected == actual