Files
scylladb/test/nodetool/test_getendpoints.py
Avi Kivity f3eade2f62 treewide: relicense to ScyllaDB-Source-Available-1.0
Drop the AGPL license in favor of a source-available license.
See the blog post [1] for details.

[1] https://www.scylladb.com/2024/12/18/why-were-moving-to-a-source-available-license/
2024-12-18 17:45:13 +02:00

26 lines
816 B
Python

#
# Copyright 2024-present ScyllaDB
#
# SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
#
import pytest
from test.nodetool.rest_api_mock import expected_request
@pytest.mark.parametrize("num_endpoints", [1, 2])
def test_getendpoints(nodetool, num_endpoints):
keyspace = 'ks'
table = 'cf0'
key = '42'
endpoints = [f"127.0.0.{i}" for i in range(num_endpoints)]
res = nodetool("getendpoints", keyspace, table, key, expected_requests=[
expected_request("GET", f"/storage_service/natural_endpoints/{keyspace}",
params={"cf": table, "key": key},
response=endpoints),
])
actual_output = res.stdout
expected_output = ''.join(f"{endpoint}\n" for endpoint in endpoints)
assert actual_output == expected_output