diff options
author | Sam James <sam@gentoo.org> | 2022-10-28 14:29:36 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-10-28 14:34:22 +0100 |
commit | a99c289b32c21c8cad1832ef6ddf9581021f682b (patch) | |
tree | 62acbe8238663685c76831c0c24e4aee19d7e1dc /dev-python/klein | |
parent | sys-kernel/pf-sources: drop 5.19_p1, 5.19_p2, 5.19_p3, 5.19_p4, 5.19_p5 (diff) | |
download | gentoo-a99c289b32c21c8cad1832ef6ddf9581021f682b.tar.gz gentoo-a99c289b32c21c8cad1832ef6ddf9581021f682b.tar.bz2 gentoo-a99c289b32c21c8cad1832ef6ddf9581021f682b.zip |
dev-python/klein: fix tests
Closes: https://bugs.gentoo.org/865677
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python/klein')
-rw-r--r-- | dev-python/klein/files/klein-21.8.0-test_resource.patch | 28 | ||||
-rw-r--r-- | dev-python/klein/klein-21.8.0.ebuild | 4 |
2 files changed, 32 insertions, 0 deletions
diff --git a/dev-python/klein/files/klein-21.8.0-test_resource.patch b/dev-python/klein/files/klein-21.8.0-test_resource.patch new file mode 100644 index 000000000000..c9779c46ac17 --- /dev/null +++ b/dev-python/klein/files/klein-21.8.0-test_resource.patch @@ -0,0 +1,28 @@ +https://github.com/twisted/klein/commit/bce8b85036a6d185b9e8aab037c805f81354544c + +From bce8b85036a6d185b9e8aab037c805f81354544c Mon Sep 17 00:00:00 2001 +From: Glyph <glyph@twistedmatrix.com> +Date: Tue, 31 May 2022 17:44:13 -0700 +Subject: [PATCH] testing exact content-length is way too strict + +--- a/src/klein/test/test_resource.py ++++ b/src/klein/test/test_resource.py +@@ -2,7 +2,7 @@ + from io import BytesIO + from types import MappingProxyType + from typing import Any, Callable, List, Mapping, Optional, Sequence, cast +-from unittest.mock import Mock, call ++from unittest.mock import ANY, Mock, call + from urllib.parse import parse_qs + + from werkzeug.exceptions import NotFound +@@ -642,7 +642,7 @@ def foo(request: IRequest) -> KleinRenderable: + request.setHeader.assert_has_calls( + [ + call(b"Content-Type", b"text/html; charset=utf-8"), +- call(b"Content-Length", b"258"), ++ call(b"Content-Length", ANY), + call(b"Location", b"http://localhost:8080/foo/"), + ] + ) + diff --git a/dev-python/klein/klein-21.8.0.ebuild b/dev-python/klein/klein-21.8.0.ebuild index 3008d5599a89..40ab5c966c28 100644 --- a/dev-python/klein/klein-21.8.0.ebuild +++ b/dev-python/klein/klein-21.8.0.ebuild @@ -30,6 +30,10 @@ BDEPEND=" ) " +PATCHES=( + "${FILESDIR}"/${P}-test_resource.patch +) + distutils_enable_tests pytest python_prepare_all() { |