summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Seichter <github@seichter.de>2019-06-29 16:45:06 +0200
committerThomas Deutschmann <whissi@gentoo.org>2019-06-29 16:55:02 +0200
commit3c24ce845a8c9999079c422f6b0512f74f901ec3 (patch)
treee433efccd054db1685d227fe9865eeac82f4d775
parentmedia-gfx/imagemagick: drop old (diff)
downloadgentoo-3c24ce845a8c9999079c422f6b0512f74f901ec3.tar.gz
gentoo-3c24ce845a8c9999079c422f6b0512f74f901ec3.tar.bz2
gentoo-3c24ce845a8c9999079c422f6b0512f74f901ec3.zip
net-misc/httpie: fix test failures
* test_ssl.py states that "pytest-httpbin doesn't support ssl3" and asserts that a caught exception contains a certain string. A patch in this ebuild extends the list of expected strings. * Added dependency to dev-python/mock. Closes: https://bugs.gentoo.org/686306 Signed-off-by: Ralph Seichter <gentoo@seichter.de> Package-Manager: Portage-2.3.66, Repoman-2.3.11 Closes: https://github.com/gentoo/gentoo/pull/12352 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rw-r--r--net-misc/httpie/files/httpie-1.0.2-fix-test_ssl.patch11
-rw-r--r--net-misc/httpie/httpie-1.0.2-r1.ebuild43
2 files changed, 54 insertions, 0 deletions
diff --git a/net-misc/httpie/files/httpie-1.0.2-fix-test_ssl.patch b/net-misc/httpie/files/httpie-1.0.2-fix-test_ssl.patch
new file mode 100644
index 000000000000..212f91f41e82
--- /dev/null
+++ b/net-misc/httpie/files/httpie-1.0.2-fix-test_ssl.patch
@@ -0,0 +1,11 @@
+--- a/tests/test_ssl.py 2018-11-14 16:36:19.000000000 +0100
++++ b/tests/test_ssl.py 2019-06-29 16:28:09.466528486 +0200
+@@ -45,7 +45,7 @@
+ except ssl_errors as e:
+ if ssl_version == 'ssl3':
+ # pytest-httpbin doesn't support ssl3
+- assert 'SSLV3_ALERT_HANDSHAKE_FAILURE' in str(e)
++ assert 'SSLV3_ALERT_HANDSHAKE_FAILURE' in str(e) or 'handshake failure' in str(e)
+ else:
+ raise
+
diff --git a/net-misc/httpie/httpie-1.0.2-r1.ebuild b/net-misc/httpie/httpie-1.0.2-r1.ebuild
new file mode 100644
index 000000000000..e7057e9fb651
--- /dev/null
+++ b/net-misc/httpie/httpie-1.0.2-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 python3_{5,6} )
+PYTHON_REQ_USE="ssl(+)"
+
+inherit bash-completion-r1 distutils-r1
+
+DESCRIPTION="Modern command line HTTP client"
+HOMEPAGE="https://httpie.org/ https://pypi.org/project/httpie/"
+SRC_URI="https://github.com/jakubroztocil/httpie/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+RDEPEND="dev-python/pygments[${PYTHON_USEDEP}]
+ >=dev-python/requests-2.19.1[${PYTHON_USEDEP}]"
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
+ test? (
+ ${RDEPEND}
+ dev-python/mock[${PYTHON_USEDEP}]
+ dev-python/pyopenssl[${PYTHON_USEDEP}]
+ dev-python/pytest-httpbin[${PYTHON_USEDEP}]
+ dev-python/pytest[${PYTHON_USEDEP}]
+ )"
+
+# Extend list of expected strings in test
+PATCHES=( "${FILESDIR}/${PN}-1.0.2-fix-test_ssl.patch" )
+
+python_test() {
+ pytest -vv || die "Tests failed with ${EPYTHON}"
+}
+
+python_install_all() {
+ newbashcomp extras/httpie-completion.bash http
+ insinto /usr/share/fish/vendor_completions.d
+ newins extras/httpie-completion.fish http.fish
+ distutils-r1_python_install_all
+}