*/*: [QA] Fix trivial cases of MissingTestRestrict
[gentoo.git] / dev-python / google-reauth-python / google-reauth-python-0.1.0.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="6"
5
6 PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
7
8 inherit distutils-r1
9
10 DESCRIPTION="Python based U2F host library"
11 HOMEPAGE="https://github.com/google/google-reauth-python"
12 SRC_URI="https://github.com/google/google-reauth-python/archive/${PV}.tar.gz -> ${P}.tar.gz"
13
14 LICENSE="Apache-2.0"
15 SLOT="0"
16 KEYWORDS="~amd64 ~arm ~x86"
17 IUSE="test"
18 RESTRICT="!test? ( test )"
19
20 RDEPEND="
21         dev-python/oauth2client[${PYTHON_USEDEP}]
22         dev-python/pyu2f[${PYTHON_USEDEP}]
23         dev-python/six[${PYTHON_USEDEP}]
24 "
25 DEPEND="
26         ${RDEPEND}
27         dev-python/setuptools[${PYTHON_USEDEP}]
28         test? (
29                 dev-python/pytest[${PYTHON_USEDEP}]
30                 dev-python/mock[${PYTHON_USEDEP}]
31         )
32 "
33
34 DOCS=( CHANGELOG.rst CONTRIBUTING.rst README.rst )
35
36 python_prepare_all() {
37         sed -e "s:'some_origin'.encode('ascii'):'some_origin':" \
38                 -e "s:SignResponse('key_handle', 'resp',:SignResponse('key_handle'.encode(), 'resp'.encode(),:" \
39                 -i tests/test_reauth.py || die
40
41         distutils-r1_python_prepare_all
42 }
43
44 python_test() {
45         py.test -v tests || die "Tests failed under ${EPYTHON}"
46 }