Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(redis): cover AWS IAM provider install on async cluster nodes

eugene-yao-zocdoc604b9edc533e
diff --git a/tests/test_litellm/test_redis.py b/tests/test_litellm/test_redis.py
index c99a3a074fb..21c23ba7866 100644
--- a/tests/test_litellm/test_redis.py
+++ b/tests/test_litellm/test_redis.py
@@ -488,6 +488,20 @@ def test_azure_wins_over_aws_iam(clean_redis_environment):
assert redis_kwargs["redis_connect_func"] is mock_azure.return_value
+def test_async_cluster_installs_aws_iam_provider(clean_redis_environment):
+ startup_nodes = [{"host": "cluster-node", "port": 6379}]
+
+ client = get_redis_async_client(
+ startup_nodes=startup_nodes,
+ aws_iam_auth=True,
+ aws_iam_user_name="iam-user",
+ aws_iam_cache_name="cache.example.com",
+ aws_iam_region="us-east-1",
+ )
+
+ assert isinstance(client.connection_kwargs["credential_provider"], ElastiCacheIAMCredentialProvider)
+
+
def test_provider_keeps_the_rest_of_the_url_intact(clean_redis_environment):
provider = _StubCredentialProvider()