mitmproxy: add tests

This commit is contained in:
blshkv 2018-05-30 15:07:54 +08:00
parent fbd4d6978f
commit e902292ee3
No known key found for this signature in database
GPG key ID: 273E3E90D1A6294F
18 changed files with 270 additions and 6 deletions

View file

@ -0,0 +1 @@
DIST async_generator-1.9.tar.gz 15711 BLAKE2B 8e6842af3d2913158b58d3407ad9dd6cdfa998491e14c7daa33319c165790d786eff5b43d467f3f27e1e3491e0804f39db0541376dfe6e250476d4384b8ee654 SHA512 c4e3295cf51e2d06ea240f9cefd135984f9e61ab6cff28f76a3a83321f7c2d811f51f8909d17d901331b55f304683b4e072d16262f5311622402568009b2d1cb

View file

@ -0,0 +1,24 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python3_{5,6} )
inherit distutils-r1
DESCRIPTION="Making it easy to write async iterators in Python 3.5"
HOMEPAGE="https://github.com/python-trio/async_generator"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
SLOT="0"
LICENSE="Apache-2.0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
#IUSE="test"
RDEPEND=""
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]"
# test? ( dev-python/pytest[${PYTHON_USEDEP}]
# dev-python/pytest-cov[${PYTHON_USEDEP}]
# )"

View file

@ -0,0 +1 @@
DIST asynctest-0.12.0.tar.gz 41172 BLAKE2B 564824987001009e59b11f6b6450e06e8a3337b85c2e57842701b8b4d0d6e174e6f9acb43e70477841eb14d0f0d4520bcde70177583428977da0254e3dd1a1a4 SHA512 6c51d2a85f7f9a46b4f45cc25c2fdc3cc94693ca1d21cd4e50d3cb2839901408b6c1bdb0bf1a4edb6700903f0f1db2d2be4c8091bcc4fddf12ccaf9f9eb09c8a

View file

@ -0,0 +1,17 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python3_{4,5,6} )
inherit distutils-r1
DESCRIPTION="Enhance the standard unittest package for testing asyncio libraries"
HOMEPAGE="https://github.com/Martiusweb/asynctest"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

View file

@ -0,0 +1 @@
DIST Flask-1.0.2.tar.gz 644534 BLAKE2B dd024f6f7a68691c759e3fd494a9482c4ab5216b5c7486fc1717346f953678c3198deedd657e7ddd3a5deff57ce31b1afdc40ef2ba9cc2fbed48f3afc223f6d0 SHA512 0ddf5d8bb0b0ae61f990096dffe3cf02744d7986015d05ae2cc09dfe0def17df44e2a4c58e330d17c7bd8c3eb74014dee5e2edef6e300b8e4ed756c251938f52

View file

@ -0,0 +1,62 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy{,3} )
inherit distutils-r1
DESCRIPTION="A microframework based on Werkzeug, Jinja2 and good intentions"
HOMEPAGE="https://github.com/pallets/flask/"
MY_PN="Flask"
MY_P="${MY_PN}-${PV}"
if [[ ${PV} == *9999* ]]; then
EGIT_REPO_URI="https://github.com/mitsuhiko/flask.git"
inherit git-r3
else
SRC_URI="mirror://pypi/${MY_P:0:1}/${MY_PN}/${MY_P}.tar.gz"
KEYWORDS="amd64 arm ~arm64 ppc ppc64 x86 ~amd64-linux ~x86-linux"
S="${WORKDIR}/${MY_P}"
fi
LICENSE="BSD"
SLOT="0"
IUSE="doc examples test"
RDEPEND=">=dev-python/click-2[${PYTHON_USEDEP}]
>=dev-python/blinker-1[${PYTHON_USEDEP}]
>=dev-python/itsdangerous-0.21[${PYTHON_USEDEP}]
>=dev-python/jinja-2.4[${PYTHON_USEDEP}]
>=dev-python/werkzeug-0.7[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
python_prepare_all() {
# Prevent un-needed d'loading
sed -e "s/ 'sphinx.ext.intersphinx',//" -i docs/conf.py || die
# DeprecationWarning: Flags not at the start of the expression
sed -e "s/r'\(.*\)\((?.*)\)'/r'\2\1'/" -i tests/test_basic.py || die
# issubclass(ModuleNotFoundError, ImportError)
# sed -e 's/\(excinfo.type\) is \(ImportError\)/issubclass(\1, \2)/' \
# -i tests/test_ext.py || die
distutils-r1_python_prepare_all
}
python_compile_all() {
use doc && emake -C docs html
}
python_test() {
PYTHONPATH=${S}/examples/flaskr:${S}/examples/minitwit${PYTHONPATH:+:${PYTHONPATH}} \
py.test -v || die "Testing failed with ${EPYTHON}"
}
python_install_all() {
use examples && dodoc -r examples
use doc && HTML_DOCS=( docs/_build/html/. )
distutils-r1_python_install_all
}

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
<upstream>
<remote-id type="pypi">Flask</remote-id>
<remote-id type="github">mitsuhiko/flask</remote-id>
</upstream>
</pkgmetadata>

View file

@ -0,0 +1 @@
DIST pytest-asyncio-0.8.0.tar.gz 11310 BLAKE2B f45f6ebeac7845637efaf67037597e5b10bc32acfd177810dbcb834d0125b091aead6cdc5a216f59e5b9a36238cb01c79a192a4f01ca3374c8d717fca621afa7 SHA512 ffae02204356ad8c936dca7d3982eda220d886d3f75619696e3146e6aacacdfc1212eed096613f9d1b3f7aa002ce9aeb8fb1a97341877c01018b59a38f05b196

View file

@ -0,0 +1,25 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python3_{5,6} )
inherit distutils-r1
DESCRIPTION="Pytest support for asyncio"
HOMEPAGE="https://github.com/pytest-dev/pytest-asyncio"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
SLOT="0"
LICENSE="Apache-2.0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="test"
RDEPEND=">=dev-python/pytest-3.0.6[${PYTHON_USEDEP}]"
# >=dev-python/async_generator-1.3[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]
test? ( dev-python/coverage[${PYTHON_USEDEP}]
>=dev-python/async_generator-1.3[${PYTHON_USEDEP}]
)"

View file

@ -0,0 +1 @@
DIST pytest-faulthandler-1.5.0.tar.gz 6882 BLAKE2B 663a0392bde6d2a6bd906d93a6e02bb1668e99900c053c807f081582507624dbdd6a3f67e5135c2c21fcdb4b399d22c3f149f6acaab6f0344b36eed83116642a SHA512 226b76e694c269d092e6bf844e38b0a76e98d314d25dd01d1b4afeae8edb966c06c294eecd2c104448b8150e7ecda4958de0d4bb38ce73976b8c19ad0a681fde

View file

@ -0,0 +1,22 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
inherit distutils-r1
DESCRIPTION="py.test plugin that activates the fault handler module during testing"
HOMEPAGE="https://github.com/pytest-dev/pytest-faulthandler"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
SLOT="0"
LICENSE="MIT"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="test"
RDEPEND="dev-python/pytest[${PYTHON_USEDEP}]
$(python_gen_cond_dep 'dev-python/faulthandler[${PYTHON_USEDEP}]' python2_7} )"
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]"

View file

@ -0,0 +1 @@
DIST pytest-xdist-1.22.2.tar.gz 57866 BLAKE2B 356f9dccb7d970e6073dc724233013503939d92072c3fab47626e9ed36778ab73499a990a6f50271ae93b82891a09be811843907c18ae64bf93f76510338c29b SHA512 69a0a233fe52ead13cadd46c134c67e4d0fdcd2a77929aea3da2530cd54c283d46c6d416a1450016ba7e9127b30bd85add99b562d9ec0a49bbe1c08b7828df68

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
<upstream>
<remote-id type="pypi">pxml</remote-id>
<remote-id type="github">metagriffin/pxml</remote-id>
<remote-id type="bitbucket">pytest-dev/pytest-xdist</remote-id>
</upstream>
</pkgmetadata>

View file

@ -0,0 +1,33 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy{,3} )
inherit distutils-r1
DESCRIPTION="Distributed testing and loop-on-failing modes"
HOMEPAGE="https://pypi.org/project/pytest-xdist/ https://github.com/pytest-dev/pytest-xdist"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
SLOT="0"
LICENSE="MIT"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd"
IUSE="test"
RDEPEND="
>=dev-python/execnet-1.1[${PYTHON_USEDEP}]
>=dev-python/pytest-3.0.0[${PYTHON_USEDEP}]
dev-python/pytest-forked[${PYTHON_USEDEP}]
>=dev-python/py-1.4.22[${PYTHON_USEDEP}]
"
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]
dev-python/setuptools_scm[${PYTHON_USEDEP}]
"
python_test() {
distutils_install_for_testing
py.test -vv || die "Tests failed under ${EPYTHON}"
}

View file

@ -0,0 +1 @@
DIST rstcheck-3.3.tar.gz 13777 BLAKE2B 1ee48f8fa97955598da114e1aeb5292325a418ff40a9628514911bcec98d26a14204bfc08aeb048830bef50a661fc9d850ef6bf5cdcb01d300036e040b4e6b85 SHA512 d5288adbd3853a0392679862edef65f8219476b8976446fd3ab5f9ec759437657d37f51125746648d5390300f6362a99fc86aa4303e2f009db715b92fe5086c8

View file

@ -0,0 +1,21 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
inherit distutils-r1
DESCRIPTION="Checks syntax of reStructuredText and code blocks nested within it"
HOMEPAGE="https://github.com/myint/rstcheck"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
RDEPEND="dev-python/docutils[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]"

View file

@ -37,22 +37,32 @@ RDEPEND="
>=dev-python/urwid-2.0.1[${PYTHON_USEDEP}] <dev-python/urwid-2.1
>=dev-python/wsproto-0.11.0[${PYTHON_USEDEP}] <dev-python/wsproto-0.12.0
examples? ( >=dev-python/pillow-4.3[${PYTHON_USEDEP}] <dev-python/pillow-5.1
dev-python/beautifulsoup:4[${PYTHON_USEDEP}] <dev-python/beautifulsoup-4.7:4
)
examples? ( dev-python/beautifulsoup:4[${PYTHON_USEDEP}] <dev-python/beautifulsoup-4.7:4 )
"
DEPEND="${RDEPEND}
test? (
>=dev-python/mock-1.0.1[${PYTHON_USEDEP}]
>=dev-python/nose-1.3.0[${PYTHON_USEDEP}]
>=dev-python/asynctest-0.12.0[${PYTHON_USEDEP}]
>=dev-python/flake8-3.5[${PYTHON_USEDEP}]
>=dev-python/flask-1.0[${PYTHON_USEDEP}]
>=dev-python/mypy-0.590[${PYTHON_USEDEP}]
>=dev-python/pytest-asyncio-0.8[${PYTHON_USEDEP}]
>=dev-python/pytest-cov-2.5.1[${PYTHON_USEDEP}]
>=dev-python/pytest-faulthandler-1.3.1[${PYTHON_USEDEP}]
>=dev-python/pytest-timeout-1.2.1[${PYTHON_USEDEP}]
>=dev-python/pytest-xdist-1.22[${PYTHON_USEDEP}]
>=dev-python/pytest-3.3[${PYTHON_USEDEP}]
>=dev-python/requests-2.9.1[${PYTHON_USEDEP}]
>=dev-python/rstcheck-2.2[${PYTHON_USEDEP}]
)
doc? ( dev-python/sphinx dev-python/sphinxcontrib-documentedlist )"
#fixme: bump it too
# =www-servers/pathod-$(get_version_component_range 1-2)*[${PYTHON_USEDEP}]
python_test() {
nosetests -v || die "Tests fail with ${EPYTHON}"
cd test/mitmproxy/addons
#tests require python3.6
"${EPYTHON}" /usr/bin/pytest -v
}
python_compile_all() {

View file

@ -246,3 +246,21 @@ dev-python/pyDes
#https://github.com/thewhiteh4t/pwnedOrNot
dev-python/cfscrape
#mitmproxy test flag:
~dev-python/rstcheck-3.3
~dev-python/pytest-timeout-1.2.1
~dev-python/mypy-0.590
~dev-python/pytest-cov-2.5.1
=dev-python/flask-1*
~dev-python/pytest-3.4.1
~dev-python/fields-5.0.0
~dev-python/pytest-asyncio-0.8.0
~dev-python/typed-ast-1.1.0
~dev-python/pytest-xdist-1.22.2
~dev-python/pytest-faulthandler-1.5.0
~dev-python/asynctest-0.12.0
~dev-python/pytest-forked-0.2
~dev-python/async_generator-1.9
~dev-python/py-1.5.3
~dev-python/attrs-17.4.0