Skip to content

Commit f2e590d

Browse files
committed
Added test case
1 parent d000b16 commit f2e590d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/test_connection_pool.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
import pytest
99
import redis
10-
from redis.connection import to_bool
10+
from redis.cache import CacheConfig
11+
from redis.connection import to_bool, CacheProxyConnection, Connection
1112
from redis.utils import SSL_AVAILABLE
1213

1314
from .conftest import _get_client, skip_if_redis_enterprise, skip_if_server_version_lt
@@ -196,6 +197,16 @@ def test_repr_contains_db_info_unix(self):
196197
expected = "path=abc,db=0,client_name=test-client"
197198
assert expected in repr(pool)
198199

200+
def test_initialise_pool_with_cache(self, master_host):
201+
pool = redis.BlockingConnectionPool(
202+
connection_class=Connection,
203+
host=master_host[0],
204+
port=master_host[1],
205+
protocol=3,
206+
cache_config=CacheConfig(),
207+
)
208+
assert isinstance(pool.get_connection("_"), CacheProxyConnection)
209+
199210

200211
class TestConnectionPoolURLParsing:
201212
def test_hostname(self):

0 commit comments

Comments
 (0)