Skip to content

Commit 2ff38d7

Browse files
committed
Revert random autoformatting
1 parent 2778765 commit 2ff38d7

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

redis/asyncio/cluster.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,9 @@ def get_node(
11541154
return self.nodes_cache.get(node_name)
11551155
else:
11561156
raise DataError(
1157-
"get_node requires one of the following: 1. node name 2. host and port"
1157+
"get_node requires one of the following: "
1158+
"1. node name "
1159+
"2. host and port"
11581160
)
11591161

11601162
def set_nodes(
@@ -1336,7 +1338,7 @@ async def initialize(self) -> None:
13361338
if len(disagreements) > 5:
13371339
raise RedisClusterException(
13381340
f"startup_nodes could not agree on a valid "
1339-
f"slots cache: {', '.join(disagreements)}"
1341+
f'slots cache: {", ".join(disagreements)}'
13401342
)
13411343

13421344
# Validate if all slots are covered or if we should try next startup node

redis/client.py

100644100755
File mode changed.

redis/cluster.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ def initialize(self):
16281628
if len(disagreements) > 5:
16291629
raise RedisClusterException(
16301630
f"startup_nodes could not agree on a valid "
1631-
f"slots cache: {', '.join(disagreements)}"
1631+
f'slots cache: {", ".join(disagreements)}'
16321632
)
16331633

16341634
fully_covered = self.check_slots_coverage(tmp_slots)

tests/test_asyncio/test_cluster.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ async def get_mocked_redis_client(
146146
with mock.patch.object(ClusterNode, "execute_command") as execute_command_mock:
147147

148148
async def execute_command(*_args, **_kwargs):
149+
149150
if _args[0] == "CLUSTER SLOTS":
150151
if cluster_slots_raise_error:
151152
raise ResponseError()
@@ -1576,23 +1577,23 @@ async def test_cluster_bitop_not_empty_string(self, r: RedisCluster) -> None:
15761577

15771578
@skip_if_server_version_lt("2.6.0")
15781579
async def test_cluster_bitop_not(self, r: RedisCluster) -> None:
1579-
test_str = b"\xaa\x00\xff\x55"
1580+
test_str = b"\xAA\x00\xFF\x55"
15801581
correct = ~0xAA00FF55 & 0xFFFFFFFF
15811582
await r.set("{foo}a", test_str)
15821583
await r.bitop("not", "{foo}r", "{foo}a")
15831584
assert int(binascii.hexlify(await r.get("{foo}r")), 16) == correct
15841585

15851586
@skip_if_server_version_lt("2.6.0")
15861587
async def test_cluster_bitop_not_in_place(self, r: RedisCluster) -> None:
1587-
test_str = b"\xaa\x00\xff\x55"
1588+
test_str = b"\xAA\x00\xFF\x55"
15881589
correct = ~0xAA00FF55 & 0xFFFFFFFF
15891590
await r.set("{foo}a", test_str)
15901591
await r.bitop("not", "{foo}a", "{foo}a")
15911592
assert int(binascii.hexlify(await r.get("{foo}a")), 16) == correct
15921593

15931594
@skip_if_server_version_lt("2.6.0")
15941595
async def test_cluster_bitop_single_string(self, r: RedisCluster) -> None:
1595-
test_str = b"\x01\x02\xff"
1596+
test_str = b"\x01\x02\xFF"
15961597
await r.set("{foo}a", test_str)
15971598
await r.bitop("and", "{foo}res1", "{foo}a")
15981599
await r.bitop("or", "{foo}res2", "{foo}a")
@@ -1603,8 +1604,8 @@ async def test_cluster_bitop_single_string(self, r: RedisCluster) -> None:
16031604

16041605
@skip_if_server_version_lt("2.6.0")
16051606
async def test_cluster_bitop_string_operands(self, r: RedisCluster) -> None:
1606-
await r.set("{foo}a", b"\x01\x02\xff\xff")
1607-
await r.set("{foo}b", b"\x01\x02\xff")
1607+
await r.set("{foo}a", b"\x01\x02\xFF\xFF")
1608+
await r.set("{foo}b", b"\x01\x02\xFF")
16081609
await r.bitop("and", "{foo}res1", "{foo}a", "{foo}b")
16091610
await r.bitop("or", "{foo}res2", "{foo}a", "{foo}b")
16101611
await r.bitop("xor", "{foo}res3", "{foo}a", "{foo}b")

tests/test_cluster.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1692,23 +1692,23 @@ def test_cluster_bitop_not_empty_string(self, r):
16921692

16931693
@skip_if_server_version_lt("2.6.0")
16941694
def test_cluster_bitop_not(self, r):
1695-
test_str = b"\xaa\x00\xff\x55"
1695+
test_str = b"\xAA\x00\xFF\x55"
16961696
correct = ~0xAA00FF55 & 0xFFFFFFFF
16971697
r["{foo}a"] = test_str
16981698
r.bitop("not", "{foo}r", "{foo}a")
16991699
assert int(binascii.hexlify(r["{foo}r"]), 16) == correct
17001700

17011701
@skip_if_server_version_lt("2.6.0")
17021702
def test_cluster_bitop_not_in_place(self, r):
1703-
test_str = b"\xaa\x00\xff\x55"
1703+
test_str = b"\xAA\x00\xFF\x55"
17041704
correct = ~0xAA00FF55 & 0xFFFFFFFF
17051705
r["{foo}a"] = test_str
17061706
r.bitop("not", "{foo}a", "{foo}a")
17071707
assert int(binascii.hexlify(r["{foo}a"]), 16) == correct
17081708

17091709
@skip_if_server_version_lt("2.6.0")
17101710
def test_cluster_bitop_single_string(self, r):
1711-
test_str = b"\x01\x02\xff"
1711+
test_str = b"\x01\x02\xFF"
17121712
r["{foo}a"] = test_str
17131713
r.bitop("and", "{foo}res1", "{foo}a")
17141714
r.bitop("or", "{foo}res2", "{foo}a")
@@ -1719,8 +1719,8 @@ def test_cluster_bitop_single_string(self, r):
17191719

17201720
@skip_if_server_version_lt("2.6.0")
17211721
def test_cluster_bitop_string_operands(self, r):
1722-
r["{foo}a"] = b"\x01\x02\xff\xff"
1723-
r["{foo}b"] = b"\x01\x02\xff"
1722+
r["{foo}a"] = b"\x01\x02\xFF\xFF"
1723+
r["{foo}b"] = b"\x01\x02\xFF"
17241724
r.bitop("and", "{foo}res1", "{foo}a", "{foo}b")
17251725
r.bitop("or", "{foo}res2", "{foo}a", "{foo}b")
17261726
r.bitop("xor", "{foo}res3", "{foo}a", "{foo}b")

0 commit comments

Comments
 (0)