blob: fb92d88b6f4fde0c415c02479a2bbe418beaa124 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
https://github.com/irmen/Pyro5/commit/8db91b617dd08508053e54dea2a781749a00ffc8.patch
https://bugs.gentoo.org/915997
From 8db91b617dd08508053e54dea2a781749a00ffc8 Mon Sep 17 00:00:00 2001
From: Irmen de Jong <irmen@razorvine.net>
Date: Sat, 21 Oct 2023 21:48:56 +0200
Subject: [PATCH] made getGetInterface test work with ipv6 localhost
---
tests/test_socketutil.py | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/tests/test_socketutil.py b/tests/test_socketutil.py
index ef0720d..c9467ae 100644
--- a/tests/test_socketutil.py
+++ b/tests/test_socketutil.py
@@ -56,10 +56,15 @@ def testGetIP6(self):
def testGetInterface(self):
addr = socketutil.get_interface("localhost")
- assert addr.version == 4
- assert str(addr).startswith("127.")
- assert str(addr.ip).startswith("127.0")
- assert str(addr.network).startswith("127.0")
+ if addr.version == 6:
+ assert str(addr).startswith("::1")
+ assert str(addr.ip) == "::1"
+ assert str(addr.network).startswith("::1")
+ else:
+ assert addr.version == 4
+ assert str(addr).startswith("127.")
+ assert str(addr.ip).startswith("127.0")
+ assert str(addr.network).startswith("127.0")
if has_ipv6:
addr = socketutil.get_interface("::1")
assert addr.version == 6
|