# Path: tests_async/transport/async_compliance.py
# class RequestResponseTests(object):
#     def server(self):
#         def index():
#         def server_error():
#         def wait():
#     async def test_request_basic(self, server):
#     async def test_request_basic_with_http(self, server):
#     async def test_request_with_timeout_success(self, server):
#     async def test_request_with_timeout_failure(self, server):
#     async def test_request_headers(self, server):
#     async def test_request_error(self, server):
#     async def test_connection_error(self):
# 
# Path: google/auth/transport/_aiohttp_requests.py
# _DEFAULT_TIMEOUT = 180  # in seconds
# class _CombinedResponse(transport.Response):
# class _Response(transport.Response):
# class Request(transport.Request):
# class AuthorizedSession(aiohttp.ClientSession):
#     def __init__(self, response):
#     def _is_compressed(self):
#     def status(self):
#     def headers(self):
#     def data(self):
#     async def raw_content(self):
#     async def content(self):
#     def __init__(self, response):
#     def status(self):
#     def headers(self):
#     def data(self):
#     def __init__(self, session=None):
#     async def __call__(
#         self,
#         url,
#         method="GET",
#         body=None,
#         headers=None,
#         timeout=_DEFAULT_TIMEOUT,
#         **kwargs,
#     ):
#     def __init__(
#         self,
#         credentials,
#         refresh_status_codes=transport.DEFAULT_REFRESH_STATUS_CODES,
#         max_refresh_attempts=transport.DEFAULT_MAX_REFRESH_ATTEMPTS,
#         refresh_timeout=None,
#         auth_request=None,
#         auto_decompress=False,
#     ):
#     async def request(
#         self,
#         method,
#         url,
#         data=None,
#         headers=None,
#         max_allowed_time=None,
#         timeout=_DEFAULT_TIMEOUT,
#         auto_decompress=False,
#         **kwargs,
#     ):


import aiohttp  # type: ignore
import mock
import pytest  # type: ignore
import google.auth._credentials_async
import google.auth.transport._mtls_helper
from aioresponses import aioresponses, core  # type: ignore
from tests_async.transport import async_compliance
from google.auth.transport import _aiohttp_requests as aiohttp_requests

    @mock.patch(
        "google.auth.transport._aiohttp_requests.urllib3.response.MultiDecoder.decompress",
        return_value="decompressed",
        autospec=True,
    )
    @pytest.mark.asyncio
    async def test_content_compressed(self, urllib3_mock):
        rm = core.RequestMatch(
            "url", headers={"Content-Encoding": "gzip"}, payload="compressed"
        )
        response = await rm.build_response(core.URL("url"))

        combined_response = aiohttp_requests._CombinedResponse(response=response)
        content = await combined_response.content()

        urllib3_mock.assert_called_once()
        assert content == "decompressed"


class TestResponse:
    def test_ctor(self):
        response = aiohttp_requests._Response(mock.sentinel.response)
        assert response._response == mock.sentinel.response

    @pytest.mark.asyncio
    async def test_headers_prop(self):
        rm = core.RequestMatch("url", headers={"Content-Encoding": "header prop"})
        mock_response = await rm.build_response(core.URL("url"))


# Path: tests_async/transport/async_compliance.py
# class RequestResponseTests(object):
#     def server(self):
#         def index():
#         def server_error():
#         def wait():
#     async def test_request_basic(self, server):
#     async def test_request_basic_with_http(self, server):
#     async def test_request_with_timeout_success(self, server):
#     async def test_request_with_timeout_failure(self, server):
#     async def test_request_headers(self, server):
#     async def test_request_error(self, server):
#     async def test_connection_error(self):
# 
# Path: google/auth/transport/_aiohttp_requests.py
# _DEFAULT_TIMEOUT = 180  # in seconds
# class _CombinedResponse(transport.Response):
# class _Response(transport.Response):
# class Request(transport.Request):
# class AuthorizedSession(aiohttp.ClientSession):
#     def __init__(self, response):
#     def _is_compressed(self):
#     def status(self):
#     def headers(self):
#     def data(self):
#     async def raw_content(self):
#     async def content(self):
#     def __init__(self, response):
#     def status(self):
#     def headers(self):
#     def data(self):
#     def __init__(self, session=None):
#     async def __call__(
#         self,
#         url,
#         method="GET",
#         body=None,
#         headers=None,
#         timeout=_DEFAULT_TIMEOUT,
#         **kwargs,
#     ):
#     def __init__(
#         self,
#         credentials,
#         refresh_status_codes=transport.DEFAULT_REFRESH_STATUS_CODES,
#         max_refresh_attempts=transport.DEFAULT_MAX_REFRESH_ATTEMPTS,
#         refresh_timeout=None,
#         auth_request=None,
#         auto_decompress=False,
#     ):
#     async def request(
#         self,
#         method,
#         url,
#         data=None,
#         headers=None,
#         max_allowed_time=None,
#         timeout=_DEFAULT_TIMEOUT,
#         auto_decompress=False,
#         **kwargs,
#     ):


# Path: tests_async/transport/test_aiohttp_requests.py
import aiohttp  # type: ignore
import mock
import pytest  # type: ignore
import google.auth._credentials_async
import google.auth.transport._mtls_helper
from aioresponses import aioresponses, core  # type: ignore
from tests_async.transport import async_compliance
from google.auth.transport import _aiohttp_requests as aiohttp_requests


    @mock.patch(
        "google.auth.transport._aiohttp_requests.urllib3.response.MultiDecoder.decompress",
        return_value="decompressed",
        autospec=True,
    )
    @pytest.mark.asyncio
    async def test_content_compressed(self, urllib3_mock):
        rm = core.RequestMatch(
            "url", headers={"Content-Encoding": "gzip"}, payload="compressed"
        )
        response = await rm.build_response(core.URL("url"))

        combined_response = aiohttp_requests._CombinedResponse(response=response)
        content = await combined_response.content()

        urllib3_mock.assert_called_once()
        assert content == "decompressed"


class TestResponse:
    def test_ctor(self):
        response = aiohttp_requests._Response(mock.sentinel.response)
        assert response._response == mock.sentinel.response

    @pytest.mark.asyncio
    async def test_headers_prop(self):
        rm = core.RequestMatch("url", headers={"Content-Encoding": "header prop"})
        mock_response = await rm.build_response(core.URL("url"))


        response = aiohttp_requests._Response(mock_response)