Skip to content

Commit

Permalink
test_redis_with_ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaan-jaff committed Nov 26, 2024
1 parent 163c6e1 commit 12a4198
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/local_testing/test_caching_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,28 @@ def test_caching_router():


# test_caching_router()
@pytest.mark.asyncio
async def test_redis_with_ssl():
"""
Test connecting to redis connection pool when ssl=None
Relevant issue:
User was seeing this error: `TypeError: AbstractConnection.__init__() got an unexpected keyword argument 'ssl'`
"""
from litellm._redis import get_redis_connection_pool, get_redis_async_client

# Get the connection pool with SSL
pool = get_redis_connection_pool(
host=os.environ.get("REDIS_HOST"),
port=os.environ.get("REDIS_PORT"),
password=os.environ.get("REDIS_PASSWORD"),
ssl=None,
)

# Create Redis client with the pool
redis_client = get_redis_async_client(connection_pool=pool)

print("pinging redis")
print(await redis_client.ping())
print("pinged redis")

0 comments on commit 12a4198

Please sign in to comment.