@@ -381,7 +381,7 @@ def test_throws_error_on_cache_enable_in_resp2(self):
381
381
382
382
def test_throws_error_on_incorrect_cache_implementation (self ):
383
383
with pytest .raises (ValueError , match = "Cache must implement CacheInterface" ):
384
- ConnectionPool (protocol = 3 , use_cache = True , cache = TTLCache ( 100 , 20 ) )
384
+ ConnectionPool (protocol = 3 , use_cache = True , cache = 'wrong' )
385
385
386
386
def test_returns_custom_cache_implementation (self , mock_cache ):
387
387
connection_pool = ConnectionPool (protocol = 3 , use_cache = True , cache = mock_cache )
@@ -423,7 +423,7 @@ def test_make_connection_proxy_connection_on_given_cache(self):
423
423
424
424
class TestUnitCacheProxyConnection :
425
425
def test_clears_cache_on_disconnect (self , mock_connection , cache_conf ):
426
- cache = DefaultCache (10 , eviction_policy = LRUPolicy ( ))
426
+ cache = DefaultCache (CacheConfiguration ( max_size = 10 ))
427
427
cache_key = CacheKey (command = "GET" , redis_keys = ("foo" ,))
428
428
429
429
cache .set (
@@ -438,7 +438,7 @@ def test_clears_cache_on_disconnect(self, mock_connection, cache_conf):
438
438
mock_connection .host = "mock"
439
439
mock_connection .port = "mock"
440
440
441
- proxy_connection = CacheProxyConnection (mock_connection , cache , cache_conf )
441
+ proxy_connection = CacheProxyConnection (mock_connection , cache )
442
442
proxy_connection .disconnect ()
443
443
444
444
assert len (cache .get_collection ()) == 0
0 commit comments