|
11 | 11 | from redis import AuthenticationError, DataError, Redis, ResponseError
|
12 | 12 | from redis.auth.err import RequestTokenErr
|
13 | 13 | from redis.backoff import NoBackoff
|
14 |
| -from redis.connection import ConnectionInterface, ConnectionPool |
| 14 | +from redis.connection import ( |
| 15 | + ConnectionInterface, |
| 16 | + ConnectionPool, |
| 17 | +) |
15 | 18 | from redis.credentials import CredentialProvider, UsernamePasswordCredentialProvider
|
16 | 19 | from redis.exceptions import ConnectionError, RedisError
|
17 | 20 | from redis.retry import Retry
|
@@ -428,6 +431,8 @@ def re_auth_callback(token):
|
428 | 431 | def test_re_auth_pub_sub_in_resp3(self, credential_provider):
|
429 | 432 | mock_pubsub_connection = Mock(spec=ConnectionInterface)
|
430 | 433 | mock_pubsub_connection.get_protocol.return_value = 3
|
| 434 | + |
| 435 | + mock_pubsub_connection.should_reconnect = Mock(return_value=False) |
431 | 436 | mock_pubsub_connection.credential_provider = credential_provider
|
432 | 437 | mock_pubsub_connection.retry = Retry(NoBackoff(), 3)
|
433 | 438 | mock_another_connection = Mock(spec=ConnectionInterface)
|
@@ -488,6 +493,7 @@ def re_auth_callback(token):
|
488 | 493 | def test_do_not_re_auth_pub_sub_in_resp2(self, credential_provider):
|
489 | 494 | mock_pubsub_connection = Mock(spec=ConnectionInterface)
|
490 | 495 | mock_pubsub_connection.get_protocol.return_value = 2
|
| 496 | + mock_pubsub_connection.should_reconnect = Mock(return_value=False) |
491 | 497 | mock_pubsub_connection.credential_provider = credential_provider
|
492 | 498 | mock_pubsub_connection.retry = Retry(NoBackoff(), 3)
|
493 | 499 | mock_another_connection = Mock(spec=ConnectionInterface)
|
|
0 commit comments