2024-01-31 09:35:12 +01:00
|
|
|
diff -Nru aiohttp-3.9.3.orig/tests/test_client_session.py aiohttp-3.9.3/tests/test_client_session.py
|
|
|
|
--- aiohttp-3.9.3.orig/tests/test_client_session.py 2024-01-29 20:32:25.000000000 +0100
|
|
|
|
+++ aiohttp-3.9.3/tests/test_client_session.py 2024-01-30 11:20:09.652810999 +0100
|
|
|
|
@@ -2,6 +2,7 @@
|
2023-11-26 02:07:55 +01:00
|
|
|
import contextlib
|
2023-10-14 19:33:08 +02:00
|
|
|
import gc
|
|
|
|
import io
|
|
|
|
+import re
|
2023-11-26 02:07:55 +01:00
|
|
|
import json
|
2023-10-14 19:33:08 +02:00
|
|
|
from http.cookies import SimpleCookie
|
|
|
|
from typing import Any, List
|
2024-01-31 09:35:12 +01:00
|
|
|
@@ -9,7 +10,6 @@
|
2023-10-14 19:33:08 +02:00
|
|
|
|
|
|
|
import pytest
|
|
|
|
from multidict import CIMultiDict, MultiDict
|
|
|
|
-from re_assert import Matches
|
|
|
|
from yarl import URL
|
|
|
|
|
|
|
|
import aiohttp
|
2024-01-31 09:35:12 +01:00
|
|
|
@@ -320,8 +320,8 @@
|
2023-10-14 19:33:08 +02:00
|
|
|
|
|
|
|
loop.run_until_complete(make_sess())
|
|
|
|
assert (
|
|
|
|
- Matches("Session and connector has to use same event loop")
|
|
|
|
- == str(ctx.value).strip()
|
|
|
|
+ re.match("Session and connector has to use same event loop",
|
|
|
|
+ str(ctx.value).strip())
|
|
|
|
)
|
|
|
|
another_loop.run_until_complete(connector.close())
|
|
|
|
|
2024-01-31 09:35:12 +01:00
|
|
|
diff -Nru aiohttp-3.9.3.orig/tests/test_streams.py aiohttp-3.9.3/tests/test_streams.py
|
|
|
|
--- aiohttp-3.9.3.orig/tests/test_streams.py 2024-01-29 20:32:25.000000000 +0100
|
|
|
|
+++ aiohttp-3.9.3/tests/test_streams.py 2024-01-30 11:20:09.652810999 +0100
|
2023-10-14 19:33:08 +02:00
|
|
|
@@ -3,13 +3,13 @@
|
|
|
|
import abc
|
|
|
|
import asyncio
|
|
|
|
import gc
|
|
|
|
+import re
|
|
|
|
import types
|
|
|
|
from collections import defaultdict
|
|
|
|
from itertools import groupby
|
|
|
|
from unittest import mock
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
-from re_assert import Matches
|
|
|
|
|
|
|
|
from aiohttp import streams
|
2023-11-26 02:07:55 +01:00
|
|
|
|
2024-01-31 09:35:12 +01:00
|
|
|
@@ -1102,7 +1102,7 @@
|
2023-10-14 19:33:08 +02:00
|
|
|
loop = asyncio.get_event_loop()
|
|
|
|
stream = self._make_one()
|
|
|
|
stream._waiter = loop.create_future()
|
|
|
|
- assert Matches(r"<StreamReader w=<Future pending[\S ]*>>") == repr(stream)
|
|
|
|
+ assert re.match(r"<StreamReader w=<Future pending[\S ]*>>", repr(stream))
|
|
|
|
stream._waiter.set_result(None)
|
|
|
|
await stream._waiter
|
|
|
|
stream._waiter = None
|
2024-01-31 09:35:12 +01:00
|
|
|
diff -Nru aiohttp-3.9.3.orig/tests/test_urldispatch.py aiohttp-3.9.3/tests/test_urldispatch.py
|
|
|
|
--- aiohttp-3.9.3.orig/tests/test_urldispatch.py 2024-01-29 20:32:25.000000000 +0100
|
|
|
|
+++ aiohttp-3.9.3/tests/test_urldispatch.py 2024-01-30 11:21:46.656743543 +0100
|
|
|
|
@@ -4,7 +4,6 @@
|
2023-10-14 19:33:08 +02:00
|
|
|
from urllib.parse import unquote
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
-from re_assert import Matches
|
|
|
|
from yarl import URL
|
|
|
|
|
|
|
|
import aiohttp
|
2024-01-31 09:35:12 +01:00
|
|
|
@@ -312,7 +311,7 @@
|
2023-10-14 19:33:08 +02:00
|
|
|
regexp = "Duplicate 'name', already handled by"
|
|
|
|
with pytest.raises(ValueError) as ctx:
|
|
|
|
router.add_route("GET", "/get_other", handler2, name="name")
|
|
|
|
- assert Matches(regexp) == str(ctx.value)
|
|
|
|
+ assert re.match(regexp, str(ctx.value))
|
|
|
|
|
|
|
|
|
|
|
|
def test_route_plain(router) -> None:
|
2024-01-31 09:35:12 +01:00
|
|
|
@@ -502,7 +501,7 @@
|
2023-10-14 19:33:08 +02:00
|
|
|
|
|
|
|
def test_static_repr(router) -> None:
|
2024-01-31 09:35:12 +01:00
|
|
|
router.add_static("/get", pathlib.Path(aiohttp.__file__).parent, name="name")
|
2023-10-14 19:33:08 +02:00
|
|
|
- assert Matches(r"<StaticResource 'name' /get") == repr(router["name"])
|
|
|
|
+ assert re.match(r"<StaticResource 'name' /get", repr(router["name"]))
|
|
|
|
|
|
|
|
|
|
|
|
def test_static_adds_slash(router) -> None:
|
2024-01-31 09:35:12 +01:00
|
|
|
@@ -624,7 +623,7 @@
|
2023-10-14 19:33:08 +02:00
|
|
|
req = make_mocked_request("GET", "/get/john")
|
|
|
|
match_info = await router.resolve(req)
|
|
|
|
assert {"name": "john"} == match_info
|
|
|
|
- assert Matches("<MatchInfo {'name': 'john'}: .+<Dynamic.+>>") == repr(match_info)
|
|
|
|
+ assert re.match("<MatchInfo {'name': 'john'}: .+<Dynamic.+>>", repr(match_info))
|
|
|
|
|
|
|
|
|
|
|
|
async def test_match_info_with_plus(router) -> None:
|
2024-01-31 09:35:12 +01:00
|
|
|
diff -Nru aiohttp-3.9.3.orig/tests/test_web_response.py aiohttp-3.9.3/tests/test_web_response.py
|
|
|
|
--- aiohttp-3.9.3.orig/tests/test_web_response.py 2024-01-29 20:32:25.000000000 +0100
|
|
|
|
+++ aiohttp-3.9.3/tests/test_web_response.py 2024-01-30 11:20:09.656144352 +0100
|
|
|
|
@@ -2,13 +2,13 @@
|
2023-10-14 19:33:08 +02:00
|
|
|
import datetime
|
|
|
|
import gzip
|
|
|
|
import json
|
|
|
|
+import re
|
|
|
|
from concurrent.futures import ThreadPoolExecutor
|
|
|
|
from unittest import mock
|
|
|
|
|
|
|
|
import aiosignal
|
|
|
|
import pytest
|
|
|
|
from multidict import CIMultiDict, CIMultiDictProxy
|
|
|
|
-from re_assert import Matches
|
|
|
|
|
|
|
|
from aiohttp import HttpVersion, HttpVersion10, HttpVersion11, hdrs
|
|
|
|
from aiohttp.helpers import ETag
|
2024-01-31 09:35:12 +01:00
|
|
|
@@ -401,7 +401,9 @@
|
2023-10-14 19:33:08 +02:00
|
|
|
|
|
|
|
with pytest.raises(RuntimeError) as ctx:
|
|
|
|
await resp.prepare(req)
|
|
|
|
- assert Matches("Using chunked encoding is forbidden for HTTP/1.0") == str(ctx.value)
|
|
|
|
+ assert re.match(
|
|
|
|
+ "Using chunked encoding is forbidden for HTTP/1.0", str(ctx.value)
|
|
|
|
+ )
|
|
|
|
|
|
|
|
|
|
|
|
async def test_compression_no_accept() -> None:
|
2024-01-31 09:35:12 +01:00
|
|
|
@@ -843,7 +845,7 @@
|
2023-10-14 19:33:08 +02:00
|
|
|
'Set-Cookie: name=("")?; '
|
|
|
|
"expires=Thu, 01 Jan 1970 00:00:00 GMT; Max-Age=0; Path=/"
|
|
|
|
)
|
|
|
|
- assert Matches(expected) == str(resp.cookies)
|
|
|
|
+ assert re.match(expected, str(resp.cookies))
|
|
|
|
|
|
|
|
resp.set_cookie("name", "value", domain="local.host")
|
|
|
|
expected = "Set-Cookie: name=value; Domain=local.host; Path=/"
|
2024-01-31 09:35:12 +01:00
|
|
|
@@ -895,7 +897,7 @@
|
2023-10-14 19:33:08 +02:00
|
|
|
'Set-Cookie: name=("")?; '
|
|
|
|
"expires=Thu, 01 Jan 1970 00:00:00 GMT; Max-Age=0; Path=/"
|
|
|
|
)
|
|
|
|
- assert Matches(expected) == str(resp.cookies)
|
|
|
|
+ assert re.match(expected, str(resp.cookies))
|
|
|
|
|
|
|
|
|
|
|
|
def test_cookie_set_after_del() -> None:
|
2024-01-31 09:35:12 +01:00
|
|
|
@@ -1136,14 +1138,13 @@
|
2023-10-14 19:33:08 +02:00
|
|
|
await resp.write_eof()
|
|
|
|
txt = buf.decode("utf8")
|
|
|
|
assert (
|
|
|
|
- Matches(
|
|
|
|
+ re.match(
|
|
|
|
"HTTP/1.1 200 OK\r\n"
|
|
|
|
"Content-Length: 0\r\n"
|
|
|
|
"Content-Type: application/octet-stream\r\n"
|
|
|
|
"Date: .+\r\n"
|
|
|
|
"Server: .+\r\n\r\n"
|
|
|
|
- )
|
|
|
|
- == txt
|
|
|
|
+ , txt)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2024-01-31 09:35:12 +01:00
|
|
|
@@ -1156,15 +1157,13 @@
|
2023-10-14 19:33:08 +02:00
|
|
|
|
|
|
|
txt = buf.decode("utf8")
|
|
|
|
assert (
|
|
|
|
- Matches(
|
|
|
|
+ re.match(
|
|
|
|
"HTTP/1.1 200 OK\r\n"
|
|
|
|
"Content-Length: 4\r\n"
|
|
|
|
"Content-Type: application/octet-stream\r\n"
|
|
|
|
"Date: .+\r\n"
|
|
|
|
"Server: .+\r\n\r\n"
|
|
|
|
- "data"
|
|
|
|
- )
|
|
|
|
- == txt
|
|
|
|
+ "data", txt)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2024-01-31 09:35:12 +01:00
|
|
|
@@ -1178,15 +1177,13 @@
|
2023-10-14 19:33:08 +02:00
|
|
|
|
|
|
|
txt = buf.decode("utf8")
|
|
|
|
assert (
|
|
|
|
- Matches(
|
|
|
|
+ re.match(
|
|
|
|
"HTTP/1.1 200 OK\r\n"
|
|
|
|
"Content-Length: 0\r\n"
|
|
|
|
"Set-Cookie: name=value\r\n"
|
|
|
|
"Content-Type: application/octet-stream\r\n"
|
|
|
|
"Date: .+\r\n"
|
|
|
|
- "Server: .+\r\n\r\n"
|
|
|
|
- )
|
|
|
|
- == txt
|
|
|
|
+ "Server: .+\r\n\r\n", txt)
|
|
|
|
)
|
|
|
|
|
|
|
|
|