|
@ -9,12 +9,26 @@ class TestPubSubManager: |
|
|
parse_redis_sentinel_url('redis://localhost:6379/0') |
|
|
parse_redis_sentinel_url('redis://localhost:6379/0') |
|
|
|
|
|
|
|
|
assert parse_redis_sentinel_url( |
|
|
assert parse_redis_sentinel_url( |
|
|
'redis+sentinel://h1:6379,h2:6379' |
|
|
'redis+sentinel://localhost:6379' |
|
|
) == ( |
|
|
) == ( |
|
|
[('h1', 6379), ('h2', 6379)], |
|
|
[('localhost', 6379)], |
|
|
|
|
|
None, |
|
|
|
|
|
{} |
|
|
|
|
|
) |
|
|
|
|
|
assert parse_redis_sentinel_url( |
|
|
|
|
|
'redis+sentinel://192.168.0.1:6379,192.168.0.2:6379/' |
|
|
|
|
|
) == ( |
|
|
|
|
|
[('192.168.0.1', 6379), ('192.168.0.2', 6379)], |
|
|
None, |
|
|
None, |
|
|
{} |
|
|
{} |
|
|
) |
|
|
) |
|
|
|
|
|
assert parse_redis_sentinel_url( |
|
|
|
|
|
'redis+sentinel://h1:6379,h2:6379/0' |
|
|
|
|
|
) == ( |
|
|
|
|
|
[('h1', 6379), ('h2', 6379)], |
|
|
|
|
|
None, |
|
|
|
|
|
{'db': 0} |
|
|
|
|
|
) |
|
|
assert parse_redis_sentinel_url( |
|
|
assert parse_redis_sentinel_url( |
|
|
'redis+sentinel://user:password@h1:6379,h2:6379,h1:6380/0/myredis' |
|
|
'redis+sentinel://user:password@h1:6379,h2:6379,h1:6380/0/myredis' |
|
|
) == ( |
|
|
) == ( |
|
|