Skip to content

Commit

Permalink
Add reproducer test for issue aio-libs#9336
Browse files Browse the repository at this point in the history
  • Loading branch information
Cycloctane committed Oct 4, 2024
1 parent 24b0e6f commit d58d8b7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_client_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from aiohttp.client_proto import ResponseHandler
from aiohttp.client_reqrep import ClientRequest, ConnectionKey
from aiohttp.connector import BaseConnector, Connection, TCPConnector, UnixConnector
from aiohttp.cookiejar import CookieJar
from aiohttp.http import RawResponseMessage
from aiohttp.pytest_plugin import AiohttpClient
from aiohttp.test_utils import make_mocked_coro
Expand Down Expand Up @@ -692,6 +693,15 @@ async def handler(request: web.Request) -> web.Response:
assert resp_cookies["response"].value == "resp_value"


@pytest.mark.xfail("Reproducer for #9336")
async def test_cookies_with_not_quoted_cookie_jar() -> None:
jar = CookieJar(quote_cookie=False)
cookies = {"name": "val=foobar"}
async with ClientSession(cookie_jar=jar) as sess:
resp = await sess.request("GET", "http://example.com", cookies=cookies)
assert resp.request_info.headers.get("Cookie") == "name=val=foobar"


async def test_session_default_version(loop: asyncio.AbstractEventLoop) -> None:
session = aiohttp.ClientSession()
assert session.version == aiohttp.HttpVersion11
Expand Down

0 comments on commit d58d8b7

Please sign in to comment.