mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-22 23:07:10 -08:00
net-im/synapse: fix tests with >=dev-python/netaddr-1.0.0
Netaddr removed implicit prefix support in netaddr-1.0.0 [1], which breaks tests in synapse. This change backports the upstream patch [2] fixing the issue to all versions present in the tree. [1] https://github.com/netaddr/netaddr/pull/360 [2] https://github.com/element-hq/synapse/pull/16953 Signed-off-by: Petr Vaněk <arkamar@gentoo.org>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
From 959bcf358cb988f242284afe61a1d99fa705150b Mon Sep 17 00:00:00 2001
|
||||
From: "Kai A. Hiller" <V02460@gmail.com>
|
||||
Date: Thu, 22 Feb 2024 20:52:27 +0100
|
||||
Subject: [PATCH] Specify IP subnet literals in canonical form
|
||||
|
||||
This is needed, because the netaddr package removed support for the
|
||||
implicit prefix form in version 1.0.0:
|
||||
https://github.com/netaddr/netaddr/pull/360
|
||||
|
||||
Upstream-PR: https://github.com/element-hq/synapse/pull/16953
|
||||
|
||||
diff --git a/tests/api/test_auth.py b/tests/api/test_auth.py
|
||||
index ce85ddf22a..bd229cf7e9 100644
|
||||
--- a/tests/api/test_auth.py
|
||||
+++ b/tests/api/test_auth.py
|
||||
@@ -128,7 +128,7 @@ def test_get_user_by_req_appservice_valid_token_good_ip(self) -> None:
|
||||
token="foobar",
|
||||
url="a_url",
|
||||
sender=self.test_user,
|
||||
- ip_range_whitelist=IPSet(["192.168/16"]),
|
||||
+ ip_range_whitelist=IPSet(["192.168.0.0/16"]),
|
||||
)
|
||||
self.store.get_app_service_by_token = Mock(return_value=app_service)
|
||||
self.store.get_user_by_access_token = AsyncMock(return_value=None)
|
||||
@@ -147,7 +147,7 @@ def test_get_user_by_req_appservice_valid_token_bad_ip(self) -> None:
|
||||
token="foobar",
|
||||
url="a_url",
|
||||
sender=self.test_user,
|
||||
- ip_range_whitelist=IPSet(["192.168/16"]),
|
||||
+ ip_range_whitelist=IPSet(["192.168.0.0/16"]),
|
||||
)
|
||||
self.store.get_app_service_by_token = Mock(return_value=app_service)
|
||||
self.store.get_user_by_access_token = AsyncMock(return_value=None)
|
||||
@@ -140,6 +140,11 @@ BDEPEND="
|
||||
)
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
# fix tests with >=dev-python/netaddr-1.0.0
|
||||
"${FILESDIR}/${PN}-1.101.0-netaddr-tests.patch"
|
||||
)
|
||||
|
||||
# Rust extension
|
||||
QA_FLAGS_IGNORED="usr/lib/python3.*/site-packages/synapse/synapse_rust.abi3.so"
|
||||
|
||||
|
||||
@@ -140,6 +140,11 @@ BDEPEND="
|
||||
)
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
# fix tests with >=dev-python/netaddr-1.0.0
|
||||
"${FILESDIR}/${P}-netaddr-tests.patch"
|
||||
)
|
||||
|
||||
# Rust extension
|
||||
QA_FLAGS_IGNORED="usr/lib/python3.*/site-packages/synapse/synapse_rust.abi3.so"
|
||||
|
||||
|
||||
@@ -140,6 +140,11 @@ BDEPEND="
|
||||
)
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
# fix tests with >=dev-python/netaddr-1.0.0
|
||||
"${FILESDIR}/${PN}-1.101.0-netaddr-tests.patch"
|
||||
)
|
||||
|
||||
# Rust extension
|
||||
QA_FLAGS_IGNORED="usr/lib/python3.*/site-packages/synapse/synapse_rust.abi3.so"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user