summaryrefslogtreecommitdiff
path: root/tests/test_asyncio/test_cluster.py
diff options
context:
space:
mode:
authorKristján Valur Jónsson <sweskman@gmail.com>2022-09-29 11:56:50 +0000
committerGitHub <noreply@github.com>2022-09-29 14:56:50 +0300
commitf014dc3a5d76935914c6e2975e66da44f2e6263b (patch)
tree465591eb372ccea9d210710d2f0b1760f9ef288d /tests/test_asyncio/test_cluster.py
parent652ca790b0bbaefa78278ddf57074316a3fb21bd (diff)
downloadredis-py-f014dc3a5d76935914c6e2975e66da44f2e6263b.tar.gz
Dev/no can read (#2360)
* make can_read() destructive for simplicity, and rename the method. Remove timeout argument, always timeout immediately. * don't use can_read in pubsub * connection.connect() now has its own retry, don't need it inside a retry loop
Diffstat (limited to 'tests/test_asyncio/test_cluster.py')
-rw-r--r--tests/test_asyncio/test_cluster.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_asyncio/test_cluster.py b/tests/test_asyncio/test_cluster.py
index 88cfb1f..f1bbe42 100644
--- a/tests/test_asyncio/test_cluster.py
+++ b/tests/test_asyncio/test_cluster.py
@@ -433,7 +433,7 @@ class TestRedisClusterObj:
Connection,
send_packed_command=mock.DEFAULT,
connect=mock.DEFAULT,
- can_read=mock.DEFAULT,
+ can_read_destructive=mock.DEFAULT,
) as mocks:
# simulate 7006 as a failed node
def execute_command_mock(self, *args, **options):
@@ -473,7 +473,7 @@ class TestRedisClusterObj:
execute_command.successful_calls = 0
execute_command.failed_calls = 0
initialize.side_effect = initialize_mock
- mocks["can_read"].return_value = False
+ mocks["can_read_destructive"].return_value = False
mocks["send_packed_command"].return_value = "MOCK_OK"
mocks["connect"].return_value = None
with mock.patch.object(
@@ -514,7 +514,7 @@ class TestRedisClusterObj:
send_command=mock.DEFAULT,
read_response=mock.DEFAULT,
_connect=mock.DEFAULT,
- can_read=mock.DEFAULT,
+ can_read_destructive=mock.DEFAULT,
on_connect=mock.DEFAULT,
) as mocks:
with mock.patch.object(
@@ -546,7 +546,7 @@ class TestRedisClusterObj:
mocks["send_command"].return_value = True
mocks["read_response"].return_value = "OK"
mocks["_connect"].return_value = True
- mocks["can_read"].return_value = False
+ mocks["can_read_destructive"].return_value = False
mocks["on_connect"].return_value = True
# Create a cluster with reading from replications