summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Deranek <marcin.deranek@slonko.net>2024-02-29 21:54:21 +0100
committerMarcin Deranek <marcin.deranek@slonko.net>2024-02-29 21:54:21 +0100
commit00f3641a5a4551fca1a12487c5aa90405fbb8c73 (patch)
tree32a949f90e3c834f9836c3da0bf492afb28fe156
parent83f6900e276d5c80dfb3f6ae913552108ca6665b (diff)
downloadportage-00f3641a5a4551fca1a12487c5aa90405fbb8c73.tar.gz
portage-00f3641a5a4551fca1a12487c5aa90405fbb8c73.tar.bz2
portage-00f3641a5a4551fca1a12487c5aa90405fbb8c73.zip
dev-python/uvicorn add missing patch
-rw-r--r--dev-python/uvicorn/files/uvicorn-0.25.0-test.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/dev-python/uvicorn/files/uvicorn-0.25.0-test.patch b/dev-python/uvicorn/files/uvicorn-0.25.0-test.patch
new file mode 100644
index 0000000..8cd1cc7
--- /dev/null
+++ b/dev-python/uvicorn/files/uvicorn-0.25.0-test.patch
@@ -0,0 +1,46 @@
+From 64013e8729afc93880a749974491ab5a90b29deb Mon Sep 17 00:00:00 2001
+From: Marcelo Trylesinski <marcelotryle@gmail.com>
+Date: Tue, 26 Dec 2023 10:28:55 +0100
+Subject: [PATCH] Allow test suite to run without httptools installed
+
+---
+ tests/protocols/test_http.py | 19 +++++++------------
+ 1 file changed, 7 insertions(+), 12 deletions(-)
+
+diff --git a/tests/protocols/test_http.py b/tests/protocols/test_http.py
+index fde4cc70b..ca06b33a6 100644
+--- a/tests/protocols/test_http.py
++++ b/tests/protocols/test_http.py
+@@ -994,25 +994,20 @@ async def test_huge_headers_h11_max_incomplete():
+
+
+ @pytest.mark.anyio
+-@pytest.mark.parametrize(
+- "protocol_cls,close_header",
+- (
+- pytest.param(
+- HttpToolsProtocol, b"connection: close", marks=skip_if_no_httptools
+- ),
+- (H11Protocol, b"Connection: close"),
+- ),
+-)
+-async def test_return_close_header(protocol_cls, close_header: bytes):
++async def test_return_close_header(
++ http_protocol_cls: "Type[HttpToolsProtocol | H11Protocol]"
++):
+ app = Response("Hello, world", media_type="text/plain")
+
+- protocol = get_connected_protocol(app, protocol_cls)
++ protocol = get_connected_protocol(app, http_protocol_cls)
+ protocol.data_received(CONNECTION_CLOSE_REQUEST)
+ await protocol.loop.run_one()
+ assert b"HTTP/1.1 200 OK" in protocol.transport.buffer
+ assert b"content-type: text/plain" in protocol.transport.buffer
+ assert b"content-length: 12" in protocol.transport.buffer
+- assert close_header in protocol.transport.buffer
++ # NOTE: We need to use `.lower()` because H11 implementation doesn't allow Uvicorn
++ # to lowercase them. See: https://github.com/python-hyper/h11/issues/156
++ assert b"connection: close" in protocol.transport.buffer.lower()
+
+
+ @pytest.mark.anyio