예제 #1
0
파일: test_pool.py 프로젝트: ods/aiochsa
async def test_params_precedence():
    async with create_pool('clickhouse://***:***@host/db',
                           user='******',
                           password='******') as pool:
        assert pool._client.params == {
            'database': 'db',
            'user': '******',
            'password': '******',
        }
예제 #2
0
async def test_session_timeout(dsn):
    async with create_pool(dsn, session_timeout=0.1) as conn:
        with pytest.raises(asyncio.TimeoutError):
            await conn.execute(LONG_QUERY)
예제 #3
0
async def test_pool_dsn_params(dsn):
    dsn += '?max_execution_time=1'
    async with create_pool(dsn) as conn:
        with pytest.raises(DBException) as exc_info:
            await conn.execute(LONG_QUERY)
    assert exc_info.value.code == error_codes.TIMEOUT_EXCEEDED