diff options
author | Dongkeun Lee <3315213+zakaf@users.noreply.github.com> | 2023-03-16 22:05:28 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-16 15:05:28 +0200 |
commit | d63313bf6080acaf18d61e072c78303adc0d4166 (patch) | |
tree | f5b5b61bbeda880a637f659c76eae29fd2a08e9b | |
parent | c61eeb2e3b5dff1f01eb1e665f424c7e75354f56 (diff) | |
download | redis-py-d63313bf6080acaf18d61e072c78303adc0d4166.tar.gz |
add queue_class to REDIS_ALLOWED_KEYS (#2577)
* add queue_class to REDIS_ALLOWED_KEYS
* fix lint
* fix lint
---------
Co-authored-by: zach.lee <zach.lee@sendbird.com>
Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
-rw-r--r-- | redis/cluster.py | 1 | ||||
-rw-r--r-- | tests/test_cluster.py | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/redis/cluster.py b/redis/cluster.py index fbda234..5e6e7da 100644 --- a/redis/cluster.py +++ b/redis/cluster.py @@ -135,6 +135,7 @@ REDIS_ALLOWED_KEYS = ( "redis_connect_func", "password", "port", + "queue_class", "retry", "retry_on_timeout", "socket_connect_timeout", diff --git a/tests/test_cluster.py b/tests/test_cluster.py index 1bf57a3..58f9b77 100644 --- a/tests/test_cluster.py +++ b/tests/test_cluster.py @@ -1,6 +1,7 @@ import binascii import datetime import warnings +from queue import LifoQueue, Queue from time import sleep from unittest.mock import DEFAULT, Mock, call, patch @@ -2511,6 +2512,18 @@ class TestNodesManager: node.redis_connection.connection_pool, connection_pool_class ) + @pytest.mark.parametrize("queue_class", [Queue, LifoQueue]) + def test_allow_custom_queue_class(self, queue_class): + rc = get_mocked_redis_client( + url="redis://my@DNS.com:7000", + cluster_slots=default_cluster_slots, + connection_pool_class=BlockingConnectionPool, + queue_class=queue_class, + ) + + for node in rc.nodes_manager.nodes_cache.values(): + assert node.redis_connection.connection_pool.queue_class == queue_class + @pytest.mark.onlycluster class TestClusterPubSubObject: |