1 |
commit: 3d8e2507826e01dc8217c02363f096963c46e815 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon May 4 08:23:57 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 4 08:34:37 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d8e2507 |
7 |
|
8 |
dev-python/pycurl: Skip telnet tests if curl[-telnet] |
9 |
|
10 |
Closes: https://bugs.gentoo.org/720906 |
11 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
12 |
|
13 |
.../pycurl/files/pycurl-7.43.0.5-telnet-test.patch | 50 ++++++++++++++++++++++ |
14 |
dev-python/pycurl/pycurl-7.43.0.5.ebuild | 4 ++ |
15 |
2 files changed, 54 insertions(+) |
16 |
|
17 |
diff --git a/dev-python/pycurl/files/pycurl-7.43.0.5-telnet-test.patch b/dev-python/pycurl/files/pycurl-7.43.0.5-telnet-test.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..c96b14d7c47 |
20 |
--- /dev/null |
21 |
+++ b/dev-python/pycurl/files/pycurl-7.43.0.5-telnet-test.patch |
22 |
@@ -0,0 +1,50 @@ |
23 |
+From 1f747cc4194601e8e54084638085d60026f1dbc4 Mon Sep 17 00:00:00 2001 |
24 |
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o> |
25 |
+Date: Mon, 4 May 2020 10:22:32 +0200 |
26 |
+Subject: [PATCH] Skip telnet tests when cURL is built without telnet support |
27 |
+ |
28 |
+--- |
29 |
+ tests/option_constants_test.py | 1 + |
30 |
+ tests/util.py | 14 ++++++++++++++ |
31 |
+ 2 files changed, 15 insertions(+) |
32 |
+ |
33 |
+diff --git a/tests/option_constants_test.py b/tests/option_constants_test.py |
34 |
+index 2d6d185..20228c6 100644 |
35 |
+--- a/tests/option_constants_test.py |
36 |
++++ b/tests/option_constants_test.py |
37 |
+@@ -387,6 +387,7 @@ class OptionConstantsSettingTest(unittest.TestCase): |
38 |
+ def test_keypasswd(self): |
39 |
+ self.curl.setopt(self.curl.KEYPASSWD, 'secret') |
40 |
+ |
41 |
++ @util.only_telnet |
42 |
+ def test_telnetoptions(self): |
43 |
+ self.curl.setopt(self.curl.TELNETOPTIONS, ('TTYPE=1', 'XDISPLOC=2')) |
44 |
+ |
45 |
+diff --git a/tests/util.py b/tests/util.py |
46 |
+index aabadf5..e12e251 100644 |
47 |
+--- a/tests/util.py |
48 |
++++ b/tests/util.py |
49 |
+@@ -138,6 +138,20 @@ def only_ssl(fn): |
50 |
+ |
51 |
+ return decorated |
52 |
+ |
53 |
++def only_telnet(fn): |
54 |
++ import nose.plugins.skip |
55 |
++ import pycurl |
56 |
++ |
57 |
++ @functools.wraps(fn) |
58 |
++ def decorated(*args, **kwargs): |
59 |
++ # pycurl.version_info()[8] is a tuple of protocols supported by libcurl |
60 |
++ if 'telnet' not in pycurl.version_info()[8]: |
61 |
++ raise nose.plugins.skip.SkipTest('libcurl does not support telnet') |
62 |
++ |
63 |
++ return fn(*args, **kwargs) |
64 |
++ |
65 |
++ return decorated |
66 |
++ |
67 |
+ def only_ssl_backends(*backends): |
68 |
+ def decorator(fn): |
69 |
+ import nose.plugins.skip |
70 |
+-- |
71 |
+2.26.2 |
72 |
+ |
73 |
|
74 |
diff --git a/dev-python/pycurl/pycurl-7.43.0.5.ebuild b/dev-python/pycurl/pycurl-7.43.0.5.ebuild |
75 |
index 4bfe4dc0519..476a879faea 100644 |
76 |
--- a/dev-python/pycurl/pycurl-7.43.0.5.ebuild |
77 |
+++ b/dev-python/pycurl/pycurl-7.43.0.5.ebuild |
78 |
@@ -49,6 +49,10 @@ DEPEND="${RDEPEND} |
79 |
# Needed for individual runs of testsuite by python impls. |
80 |
DISTUTILS_IN_SOURCE_BUILD=1 |
81 |
|
82 |
+PATCHES=( |
83 |
+ "${FILESDIR}"/pycurl-7.43.0.5-telnet-test.patch |
84 |
+) |
85 |
+ |
86 |
python_prepare_all() { |
87 |
sed -e "/setup_args\['data_files'\] = /d" -i setup.py || die |
88 |
distutils-r1_python_prepare_all |