Merge remote-tracking branch 'github/pr/463'.
[gentoo.git] / dev-python / httpretty / httpretty-0.7.0.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 PYTHON_COMPAT=( python2_7 )
7
8 inherit distutils-r1
9
10 DESCRIPTION="HTTP client mock for Python"
11 HOMEPAGE="https://github.com/gabrielfalcao/httpretty"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 KEYWORDS="~amd64 ~x86"
15 IUSE="test"
16 LICENSE="MIT"
17 SLOT="0"
18
19 RDEPEND="dev-python/urllib3[${PYTHON_USEDEP}]
20                 >=dev-python/coverage-3.5[${PYTHON_USEDEP}]
21                 dev-python/httplib2[${PYTHON_USEDEP}]
22                 >=dev-python/mock-1.0[${PYTHON_USEDEP}]
23                 >=dev-python/nose-1.2[${PYTHON_USEDEP}]
24                 >=dev-python/requests-1.1[${PYTHON_USEDEP}]
25                 >=dev-python/steadymark-0.4.5[${PYTHON_USEDEP}]
26                 >=dev-python/sure-1.2.1[${PYTHON_USEDEP}]
27                 >=www-servers/tornado-2.2[${PYTHON_USEDEP}]
28                 "
29 # I believe we don't need unpackaged package markment
30 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
31         test? ( ${RDEPEND} )"
32
33 PATCHES=( "${FILESDIR}"/${P}-deps.patch )
34
35 python_prepare_all() {
36         distutils-r1_python_prepare_all
37         if ! use test; then
38                 rm -rf tests/
39         fi
40 }
41
42 python_test() {
43         # https://github.com/gabrielfalcao/HTTPretty/issues/125
44         nosetests tests/unit \
45                 -e test_recording_calls \
46                 -e test_playing_calls \
47                 -e test_callback_setting_headers_and_status_response \
48                 -e test_streaming_responses \
49                 tests/functional || die "Tests failed under ${EPYTHON}"
50         rm -rf tests/ "${BUILD_DIR}"/lib/tests/ || die
51 }