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
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