# Path: aiobotocore/httpsession.py
# class AIOHTTPSession:
#     def __init__(
#             self,
#             verify: bool = True,
#             proxies: Dict[str, str] = None,  # {scheme: url}
#             timeout: float = None,
#             max_pool_connections: int = MAX_POOL_CONNECTIONS,
#             socket_options=None,
#             client_cert=None,
#             proxies_config=None,
#             connector_args=None
#     ):
#     async def __aenter__(self):
#     async def __aexit__(self, exc_type, exc_val, exc_tb):
#     async def close(self):
#     def _get_ssl_context(self):
#     def _setup_proxy_ssl_context(self, proxies_settings):
#     async def send(self, request):


import asyncio
import pytest
import aioitertools
import aiobotocore.retries.adaptive
import botocore.retries.adaptive
from collections import defaultdict
from aiobotocore import httpsession
async def test_can_make_request(s3_client):
    # Basic smoke test to ensure we can talk to s3.
    result = await s3_client.list_buckets()
    # Can't really assume anything about whether or not they have buckets,
    # but we can assume something about the structure of the response.
    actual_keys = sorted(list(result.keys()))
    assert actual_keys == ['Buckets', 'Owner', 'ResponseMetadata']


@pytest.mark.moto
@pytest.mark.parametrize('s3_verify', [False])
@pytest.mark.asyncio
async def test_can_make_request_no_verify(s3_client):
    # Basic smoke test to ensure we can talk to s3.
    result = await s3_client.list_buckets()
    # Can't really assume anything about whether or not they have buckets,
    # but we can assume something about the structure of the response.
    actual_keys = sorted(list(result.keys()))
    assert actual_keys == ['Buckets', 'Owner', 'ResponseMetadata']


@pytest.mark.moto
@pytest.mark.asyncio
async def test_fail_proxy_request(aa_fail_proxy_config, s3_client, monkeypatch):
    # based on test_can_make_request

    monkeypatch.setattr(httpsession, 'DEPRECATED_1_4_0_APIS', 1)
    with pytest.raises(httpsession.ClientProxyConnectionError):
        await s3_client.list_buckets()


# Path: aiobotocore/httpsession.py
# class AIOHTTPSession:
#     def __init__(
#             self,
#             verify: bool = True,
#             proxies: Dict[str, str] = None,  # {scheme: url}
#             timeout: float = None,
#             max_pool_connections: int = MAX_POOL_CONNECTIONS,
#             socket_options=None,
#             client_cert=None,
#             proxies_config=None,
#             connector_args=None
#     ):
#     async def __aenter__(self):
#     async def __aexit__(self, exc_type, exc_val, exc_tb):
#     async def close(self):
#     def _get_ssl_context(self):
#     def _setup_proxy_ssl_context(self, proxies_settings):
#     async def send(self, request):


# Path: tests/test_basic_s3.py
import asyncio
import pytest
import aioitertools
import aiobotocore.retries.adaptive
import botocore.retries.adaptive
from collections import defaultdict
from aiobotocore import httpsession

async def test_can_make_request(s3_client):
    # Basic smoke test to ensure we can talk to s3.
    result = await s3_client.list_buckets()
    # Can't really assume anything about whether or not they have buckets,
    # but we can assume something about the structure of the response.
    actual_keys = sorted(list(result.keys()))
    assert actual_keys == ['Buckets', 'Owner', 'ResponseMetadata']


@pytest.mark.moto
@pytest.mark.parametrize('s3_verify', [False])
@pytest.mark.asyncio
async def test_can_make_request_no_verify(s3_client):
    # Basic smoke test to ensure we can talk to s3.
    result = await s3_client.list_buckets()
    # Can't really assume anything about whether or not they have buckets,
    # but we can assume something about the structure of the response.
    actual_keys = sorted(list(result.keys()))
    assert actual_keys == ['Buckets', 'Owner', 'ResponseMetadata']


@pytest.mark.moto
@pytest.mark.asyncio
async def test_fail_proxy_request(aa_fail_proxy_config, s3_client, monkeypatch):
    # based on test_can_make_request

    monkeypatch.setattr(httpsession, 'DEPRECATED_1_4_0_APIS', 1)
    with pytest.raises(httpsession.ClientProxyConnectionError):
        await s3_client.list_buckets()


    monkeypatch.setattr(httpsession, 'DEPRECATED_1_4_0_APIS', 0)