Ejemplo n.º 1
0
async def test_redis_sentinel_failure(create_pool, cancel_remaining_task,
                                      mocker):
    settings = RedisSettings()
    settings.host = [('localhost', 6379), ('localhost', 6379)]
    settings.sentinel = True
    with pytest.raises(ResponseError, match='unknown command `SENTINEL`'):
        await create_pool(settings)
Ejemplo n.º 2
0
async def test_redis_sentinel_failure():
    settings = RedisSettings()
    settings.host = [('localhost', 6379), ('localhost', 6379)]
    settings.sentinel = True
    try:
        pool = await create_pool(settings)
        await pool.ping('ping')
    except Exception as e:
        assert 'unknown command `SENTINEL`' in str(e)
Ejemplo n.º 3
0
async def test_redis_sentinel_failure(create_pool):
    """
    FIXME: this is currently causing 3 "Task was destroyed but it is pending!" warnings
    """
    settings = RedisSettings()
    settings.host = [('localhost', 6379), ('localhost', 6379)]
    settings.sentinel = True
    try:
        pool = await create_pool(settings)
        await pool.ping('ping')
    except Exception as e:
        assert 'unknown command `SENTINEL`' in str(e)