Skip to content

Commit

Permalink
Added test case
Browse files Browse the repository at this point in the history
  • Loading branch information
vladvildanov committed Jan 6, 2025
1 parent d000b16 commit f2e590d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

import pytest
import redis
from redis.connection import to_bool
from redis.cache import CacheConfig
from redis.connection import to_bool, CacheProxyConnection, Connection
from redis.utils import SSL_AVAILABLE

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

def test_initialise_pool_with_cache(self, master_host):
pool = redis.BlockingConnectionPool(
connection_class=Connection,
host=master_host[0],
port=master_host[1],
protocol=3,
cache_config=CacheConfig(),
)
assert isinstance(pool.get_connection("_"), CacheProxyConnection)


class TestConnectionPoolURLParsing:
def test_hostname(self):
Expand Down

0 comments on commit f2e590d

Please sign in to comment.