File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 77
88import pytest
99import redis
10- from redis .connection import to_bool
10+ from redis .cache import CacheConfig
11+ from redis .connection import to_bool , CacheProxyConnection , Connection
1112from redis .utils import SSL_AVAILABLE
1213
1314from .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
200211class TestConnectionPoolURLParsing :
201212 def test_hostname (self ):
You can’t perform that action at this time.
0 commit comments