@@ -152,7 +152,6 @@ async def get_mocked_redis_client(
152
152
with mock .patch .object (ClusterNode , "execute_command" ) as execute_command_mock :
153
153
154
154
async def execute_command (* _args , ** _kwargs ):
155
-
156
155
if _args [0 ] == "CLUSTER SLOTS" :
157
156
if cluster_slots_raise_error :
158
157
raise ResponseError ()
@@ -197,7 +196,8 @@ def __del__(self):
197
196
@property
198
197
def connection_pool (self ):
199
198
# Required abstract property implementation
200
- return self .nodes_manager .get_default_node ().redis_connection .connection_pool
199
+ default_node = self .nodes_manager .get_default_node ()
200
+ return default_node .redis_connection .connection_pool
201
201
202
202
return await MockedRedisCluster (* args , ** kwargs )
203
203
@@ -1643,23 +1643,23 @@ async def test_cluster_bitop_not_empty_string(self, r: RedisCluster) -> None:
1643
1643
1644
1644
@skip_if_server_version_lt ("2.6.0" )
1645
1645
async def test_cluster_bitop_not (self , r : RedisCluster ) -> None :
1646
- test_str = b"\xAA \x00 \xFF \x55 "
1646
+ test_str = b"\xaa \x00 \xff \x55 "
1647
1647
correct = ~ 0xAA00FF55 & 0xFFFFFFFF
1648
1648
await r .set ("{foo}a" , test_str )
1649
1649
await r .bitop ("not" , "{foo}r" , "{foo}a" )
1650
1650
assert int (binascii .hexlify (await r .get ("{foo}r" )), 16 ) == correct
1651
1651
1652
1652
@skip_if_server_version_lt ("2.6.0" )
1653
1653
async def test_cluster_bitop_not_in_place (self , r : RedisCluster ) -> None :
1654
- test_str = b"\xAA \x00 \xFF \x55 "
1654
+ test_str = b"\xaa \x00 \xff \x55 "
1655
1655
correct = ~ 0xAA00FF55 & 0xFFFFFFFF
1656
1656
await r .set ("{foo}a" , test_str )
1657
1657
await r .bitop ("not" , "{foo}a" , "{foo}a" )
1658
1658
assert int (binascii .hexlify (await r .get ("{foo}a" )), 16 ) == correct
1659
1659
1660
1660
@skip_if_server_version_lt ("2.6.0" )
1661
1661
async def test_cluster_bitop_single_string (self , r : RedisCluster ) -> None :
1662
- test_str = b"\x01 \x02 \xFF "
1662
+ test_str = b"\x01 \x02 \xff "
1663
1663
await r .set ("{foo}a" , test_str )
1664
1664
await r .bitop ("and" , "{foo}res1" , "{foo}a" )
1665
1665
await r .bitop ("or" , "{foo}res2" , "{foo}a" )
@@ -1670,8 +1670,8 @@ async def test_cluster_bitop_single_string(self, r: RedisCluster) -> None:
1670
1670
1671
1671
@skip_if_server_version_lt ("2.6.0" )
1672
1672
async def test_cluster_bitop_string_operands (self , r : RedisCluster ) -> None :
1673
- await r .set ("{foo}a" , b"\x01 \x02 \xFF \xFF " )
1674
- await r .set ("{foo}b" , b"\x01 \x02 \xFF " )
1673
+ await r .set ("{foo}a" , b"\x01 \x02 \xff \xff " )
1674
+ await r .set ("{foo}b" , b"\x01 \x02 \xff " )
1675
1675
await r .bitop ("and" , "{foo}res1" , "{foo}a" , "{foo}b" )
1676
1676
await r .bitop ("or" , "{foo}res2" , "{foo}a" , "{foo}b" )
1677
1677
await r .bitop ("xor" , "{foo}res3" , "{foo}a" , "{foo}b" )
0 commit comments