summaryrefslogtreecommitdiff
path: root/tests/test_cluster.py
diff options
context:
space:
mode:
authordvora-h <67596500+dvora-h@users.noreply.github.com>2022-03-14 13:44:25 +0200
committerGitHub <noreply@github.com>2022-03-14 13:44:25 +0200
commita6a003c1b04635b5c40616faf451a09c5bc6372d (patch)
tree685e635e1d5060ac63ad2168d6831705fecd1e6a /tests/test_cluster.py
parent5d5f8923e48f7fe2d30959db50cc9bcfc953578b (diff)
downloadredis-py-a6a003c1b04635b5c40616faf451a09c5bc6372d.tar.gz
Add support for CLUSTER LINKS (#2019)
* cluster links * docstring * skip test Co-authored-by: Chayim <chayim@users.noreply.github.com>
Diffstat (limited to 'tests/test_cluster.py')
-rw-r--r--tests/test_cluster.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_cluster.py b/tests/test_cluster.py
index 43e5632..e9242e0 100644
--- a/tests/test_cluster.py
+++ b/tests/test_cluster.py
@@ -1029,6 +1029,17 @@ class TestClusterRedisCommands:
== "r4xfga22229cf3c652b6fca0d09ff69f3e0d4d"
)
+ @skip_if_server_version_lt("7.0.0")
+ def test_cluster_links(self, r):
+ node = r.get_random_node()
+ res = r.cluster_links(node)
+ links_to = sum(x.count("to") for x in res)
+ links_for = sum(x.count("from") for x in res)
+ assert links_to == links_for
+ print(res)
+ for i in range(0, len(res) - 1, 2):
+ assert res[i][3] == res[i + 1][3]
+
def test_readonly(self):
r = get_mocked_redis_client(host=default_host, port=default_port)
mock_all_nodes_resp(r, "OK")