Skip to content

Commit

Permalink
Add xfail test for #9336 (#9418)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cycloctane authored Oct 6, 2024
1 parent 6d8562d commit dfa1b7e
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/test_client_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
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.pytest_plugin import AiohttpClient, AiohttpServer
from aiohttp.test_utils import make_mocked_coro
from aiohttp.tracing import Trace

Expand Down Expand Up @@ -692,6 +693,23 @@ async def handler(request: web.Request) -> web.Response:
assert resp_cookies["response"].value == "resp_value"


@pytest.mark.xfail(reason="Reproducer for #9336")
async def test_cookies_with_not_quoted_cookie_jar(
aiohttp_server: AiohttpServer,
) -> None:
async def handler(_: web.Request) -> web.Response:
return web.Response()

app = web.Application()
app.router.add_route("GET", "/", handler)
server = await aiohttp_server(app)
jar = CookieJar(quote_cookie=False)
cookies = {"name": "val=foobar"}
async with aiohttp.ClientSession(cookie_jar=jar) as sess:
resp = await sess.request("GET", server.make_url("/"), 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 dfa1b7e

Please sign in to comment.