From f9cbe1dac699c6308d6666fe709a619a31bbf029 Mon Sep 17 00:00:00 2001 From: phi Date: Sat, 30 Aug 2025 17:51:12 +0900 Subject: [PATCH] test: test valkey url --- tests/common/test_redis_manager.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/common/test_redis_manager.py b/tests/common/test_redis_manager.py index 3e5ee1e..66a667e 100644 --- a/tests/common/test_redis_manager.py +++ b/tests/common/test_redis_manager.py @@ -4,33 +4,34 @@ from socketio.redis_manager import parse_redis_sentinel_url class TestPubSubManager: - def test_sentinel_url_parser(self): + @pytest.mark.parametrize('rtype', ['redis', 'valkey']) + def test_sentinel_url_parser(self, rtype): with pytest.raises(ValueError): - parse_redis_sentinel_url('redis://localhost:6379/0') + parse_redis_sentinel_url(f'{rtype}://localhost:6379/0') assert parse_redis_sentinel_url( - 'redis+sentinel://localhost:6379' + f'{rtype}+sentinel://localhost:6379' ) == ( [('localhost', 6379)], None, {} ) assert parse_redis_sentinel_url( - 'redis+sentinel://192.168.0.1:6379,192.168.0.2:6379/' + f'{rtype}+sentinel://192.168.0.1:6379,192.168.0.2:6379/' ) == ( [('192.168.0.1', 6379), ('192.168.0.2', 6379)], None, {} ) assert parse_redis_sentinel_url( - 'redis+sentinel://h1:6379,h2:6379/0' + f'{rtype}+sentinel://h1:6379,h2:6379/0' ) == ( [('h1', 6379), ('h2', 6379)], None, {'db': 0} ) assert parse_redis_sentinel_url( - 'redis+sentinel://user:password@h1:6379,h2:6379,h1:6380/0/myredis' + f'{rtype}+sentinel://user:password@h1:6379,h2:6379,h1:6380/0/myredis' ) == ( [('h1', 6379), ('h2', 6379), ('h1', 6380)], 'myredis',