Skip to content

Commit 533e99e

Browse files
committed
Revert random autoformatting
1 parent c1a3202 commit 533e99e

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

Diff for: redis/asyncio/cluster.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,9 @@ def get_node(
11611161
return self.nodes_cache.get(node_name)
11621162
else:
11631163
raise DataError(
1164-
"get_node requires one of the following: 1. node name 2. host and port"
1164+
"get_node requires one of the following: "
1165+
"1. node name "
1166+
"2. host and port"
11651167
)
11661168

11671169
def set_nodes(
@@ -1343,7 +1345,7 @@ async def initialize(self) -> None:
13431345
if len(disagreements) > 5:
13441346
raise RedisClusterException(
13451347
f"startup_nodes could not agree on a valid "
1346-
f"slots cache: {', '.join(disagreements)}"
1348+
f'slots cache: {", ".join(disagreements)}'
13471349
)
13481350

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

Diff for: redis/client.py

100644100755
File mode changed.

Diff for: redis/cluster.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1635,7 +1635,7 @@ def initialize(self):
16351635
if len(disagreements) > 5:
16361636
raise RedisClusterException(
16371637
f"startup_nodes could not agree on a valid "
1638-
f"slots cache: {', '.join(disagreements)}"
1638+
f'slots cache: {", ".join(disagreements)}'
16391639
)
16401640

16411641
fully_covered = self.check_slots_coverage(tmp_slots)

Diff for: 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")

Diff for: 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)