# Path: aredis/pool.py
# def to_bool(value):
#     if value is None or value == '':
#         return None
#     if isinstance(value, str) and value.upper() in FALSE_STRINGS:
#         return False
#     return bool(value)
# 
# Path: aredis/exceptions.py
# class ConnectionError(RedisError):
#     pass
# 
# class RedisError(Exception):
#     pass
# 
# class BusyLoadingError(ConnectionError):
#     pass
# 
# class ReadOnlyError(ResponseError):
#     pass
# 
# Path: tests/client/conftest.py
# def skip_if_server_version_lt(min_version):
#     loop = asyncio.get_event_loop()
#     version = StrictVersion(loop.run_until_complete(get_version()))
#     check = version < StrictVersion(min_version)
#     return pytest.mark.skipif(check, reason="")


import os
import pytest
import aredis
import re
import asyncio
        import warnings
        import ssl
from aredis.pool import to_bool
from aredis.exceptions import (ConnectionError, RedisError,
                               BusyLoadingError, ReadOnlyError)
from .conftest import skip_if_server_version_lt
    def test_db_in_querystring(self):
        pool = aredis.ConnectionPool.from_url('unix:///socket?db=2', db=1)
        assert pool.connection_class == aredis.UnixDomainSocketConnection
        assert pool.connection_kwargs == {
            'path': '/socket',
            'db': 2,
            'password': None,
        }

    def test_extra_querystring_options(self):
        pool = aredis.ConnectionPool.from_url('unix:///socket?a=1&b=2')
        assert pool.connection_class == aredis.UnixDomainSocketConnection
        assert pool.connection_kwargs == {
            'path': '/socket',
            'db': 0,
            'password': None,
            'a': '1',
            'b': '2'
        }


class TestSSLConnectionURLParsing:
    def test_defaults(self):
        pool = aredis.ConnectionPool.from_url('rediss://localhost')
        assert pool.connection_class == aredis.Connection
        assert pool.connection_kwargs.pop('ssl_context') is not None
        assert pool.connection_kwargs == {
            'host': 'localhost',
            'port': 6379,
            'db': 0,

# Path: aredis/pool.py
# def to_bool(value):
#     if value is None or value == '':
#         return None
#     if isinstance(value, str) and value.upper() in FALSE_STRINGS:
#         return False
#     return bool(value)
# 
# Path: aredis/exceptions.py
# class ConnectionError(RedisError):
#     pass
# 
# class RedisError(Exception):
#     pass
# 
# class BusyLoadingError(ConnectionError):
#     pass
# 
# class ReadOnlyError(ResponseError):
#     pass
# 
# Path: tests/client/conftest.py
# def skip_if_server_version_lt(min_version):
#     loop = asyncio.get_event_loop()
#     version = StrictVersion(loop.run_until_complete(get_version()))
#     check = version < StrictVersion(min_version)
#     return pytest.mark.skipif(check, reason="")


# Path: tests/client/test_connection_pool.py
import os
import pytest
import aredis
import re
import asyncio
        import warnings
        import ssl
from aredis.pool import to_bool
from aredis.exceptions import (ConnectionError, RedisError,
                               BusyLoadingError, ReadOnlyError)
from .conftest import skip_if_server_version_lt

    def test_db_in_querystring(self):
        pool = aredis.ConnectionPool.from_url('unix:///socket?db=2', db=1)
        assert pool.connection_class == aredis.UnixDomainSocketConnection
        assert pool.connection_kwargs == {
            'path': '/socket',
            'db': 2,
            'password': None,
        }

    def test_extra_querystring_options(self):
        pool = aredis.ConnectionPool.from_url('unix:///socket?a=1&b=2')
        assert pool.connection_class == aredis.UnixDomainSocketConnection
        assert pool.connection_kwargs == {
            'path': '/socket',
            'db': 0,
            'password': None,
            'a': '1',
            'b': '2'
        }


class TestSSLConnectionURLParsing:
    def test_defaults(self):
        pool = aredis.ConnectionPool.from_url('rediss://localhost')
        assert pool.connection_class == aredis.Connection
        assert pool.connection_kwargs.pop('ssl_context') is not None
        assert pool.connection_kwargs == {
            'host': 'localhost',
            'port': 6379,
            'db': 0,

            'password': None,