Skip to content

Commit f9cbe1d

Browse files
committed
test: test valkey url
1 parent a8470ce commit f9cbe1d

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

tests/common/test_redis_manager.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,34 @@
44

55

66
class TestPubSubManager:
7-
def test_sentinel_url_parser(self):
7+
@pytest.mark.parametrize('rtype', ['redis', 'valkey'])
8+
def test_sentinel_url_parser(self, rtype):
89
with pytest.raises(ValueError):
9-
parse_redis_sentinel_url('redis://localhost:6379/0')
10+
parse_redis_sentinel_url(f'{rtype}://localhost:6379/0')
1011

1112
assert parse_redis_sentinel_url(
12-
'redis+sentinel://localhost:6379'
13+
f'{rtype}+sentinel://localhost:6379'
1314
) == (
1415
[('localhost', 6379)],
1516
None,
1617
{}
1718
)
1819
assert parse_redis_sentinel_url(
19-
'redis+sentinel://192.168.0.1:6379,192.168.0.2:6379/'
20+
f'{rtype}+sentinel://192.168.0.1:6379,192.168.0.2:6379/'
2021
) == (
2122
[('192.168.0.1', 6379), ('192.168.0.2', 6379)],
2223
None,
2324
{}
2425
)
2526
assert parse_redis_sentinel_url(
26-
'redis+sentinel://h1:6379,h2:6379/0'
27+
f'{rtype}+sentinel://h1:6379,h2:6379/0'
2728
) == (
2829
[('h1', 6379), ('h2', 6379)],
2930
None,
3031
{'db': 0}
3132
)
3233
assert parse_redis_sentinel_url(
33-
'redis+sentinel://user:password@h1:6379,h2:6379,h1:6380/0/myredis'
34+
f'{rtype}+sentinel://user:password@h1:6379,h2:6379,h1:6380/0/myredis'
3435
) == (
3536
[('h1', 6379), ('h2', 6379), ('h1', 6380)],
3637
'myredis',

0 commit comments

Comments
 (0)