summaryrefslogtreecommitdiff
path: root/tests/test_cluster.py
diff options
context:
space:
mode:
authorUtkarsh Gupta <utkarshgupta137@gmail.com>2022-05-30 20:05:19 +0530
committerGitHub <noreply@github.com>2022-05-30 17:35:19 +0300
commitc54dfa49dda6a7b3389dc230726293af3ffc68a3 (patch)
treefd972a79a8bef1b29829426c86a7386abb44ba73 /tests/test_cluster.py
parentf704281cf4c1f735c06a13946fcea42fa939e3a5 (diff)
downloadredis-py-c54dfa49dda6a7b3389dc230726293af3ffc68a3.tar.gz
update black to 22.3.0 (#2171)
Diffstat (limited to 'tests/test_cluster.py')
-rw-r--r--tests/test_cluster.py64
1 files changed, 10 insertions, 54 deletions
diff --git a/tests/test_cluster.py b/tests/test_cluster.py
index de41a10..c74af20 100644
--- a/tests/test_cluster.py
+++ b/tests/test_cluster.py
@@ -44,12 +44,7 @@ from .conftest import (
default_host = "127.0.0.1"
default_port = 7000
default_cluster_slots = [
- [
- 0,
- 8191,
- ["127.0.0.1", 7000, "node_0"],
- ["127.0.0.1", 7003, "node_3"],
- ],
+ [0, 8191, ["127.0.0.1", 7000, "node_0"], ["127.0.0.1", 7003, "node_3"]],
[8192, 16383, ["127.0.0.1", 7001, "node_1"], ["127.0.0.1", 7002, "node_2"]],
]
@@ -905,16 +900,8 @@ class TestClusterRedisCommands:
@skip_if_redis_enterprise()
def test_cluster_delslots(self):
cluster_slots = [
- [
- 0,
- 8191,
- ["127.0.0.1", 7000, "node_0"],
- ],
- [
- 8192,
- 16383,
- ["127.0.0.1", 7001, "node_1"],
- ],
+ [0, 8191, ["127.0.0.1", 7000, "node_0"]],
+ [8192, 16383, ["127.0.0.1", 7001, "node_1"]],
]
r = get_mocked_redis_client(
host=default_host, port=default_port, cluster_slots=cluster_slots
@@ -2123,34 +2110,14 @@ class TestNodesManager:
"""
if port == 7000:
result = [
- [
- 0,
- 5460,
- ["127.0.0.1", 7000],
- ["127.0.0.1", 7003],
- ],
- [
- 5461,
- 10922,
- ["127.0.0.1", 7001],
- ["127.0.0.1", 7004],
- ],
+ [0, 5460, ["127.0.0.1", 7000], ["127.0.0.1", 7003]],
+ [5461, 10922, ["127.0.0.1", 7001], ["127.0.0.1", 7004]],
]
elif port == 7001:
result = [
- [
- 0,
- 5460,
- ["127.0.0.1", 7001],
- ["127.0.0.1", 7003],
- ],
- [
- 5461,
- 10922,
- ["127.0.0.1", 7000],
- ["127.0.0.1", 7004],
- ],
+ [0, 5460, ["127.0.0.1", 7001], ["127.0.0.1", 7003]],
+ [5461, 10922, ["127.0.0.1", 7000], ["127.0.0.1", 7004]],
]
else:
result = []
@@ -2217,16 +2184,8 @@ class TestNodesManager:
def execute_command(*args, **kwargs):
if args[0] == "CLUSTER SLOTS":
return [
- [
- 0,
- 8191,
- ["127.0.0.1", 7001, "node_1"],
- ],
- [
- 8192,
- 16383,
- ["127.0.0.1", 7002, "node_2"],
- ],
+ [0, 8191, ["127.0.0.1", 7001, "node_1"]],
+ [8192, 16383, ["127.0.0.1", 7002, "node_2"]],
]
elif args[0] == "INFO":
return {"cluster_enabled": True}
@@ -2673,10 +2632,7 @@ class TestReadOnlyPipeline:
with r.pipeline() as readonly_pipe:
readonly_pipe.get("foo71").zrange("foo88", 0, 5, withscores=True)
- assert readonly_pipe.execute() == [
- b"a1",
- [(b"z1", 1.0), (b"z2", 4)],
- ]
+ assert readonly_pipe.execute() == [b"a1", [(b"z1", 1.0), (b"z2", 4)]]
def test_moved_redirection_on_slave_with_default(self, r):
"""