summaryrefslogtreecommitdiff
path: root/dev-python/flask-mongoengine
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-04-28 20:21:43 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-04-28 20:21:43 +0100
commit40aaaa64e86ba6710bbeb31c4615a6ce80e75e11 (patch)
tree758c221bad35c9288d0bd6df9c7dfc226728e52c /dev-python/flask-mongoengine
parent8d5dbd847cbc704a6a06405856e94b461011afe3 (diff)
gentoo resync : 28.04.2021
Diffstat (limited to 'dev-python/flask-mongoengine')
-rw-r--r--dev-python/flask-mongoengine/Manifest2
-rw-r--r--dev-python/flask-mongoengine/flask-mongoengine-1.0.0.ebuild46
2 files changed, 43 insertions, 5 deletions
diff --git a/dev-python/flask-mongoengine/Manifest b/dev-python/flask-mongoengine/Manifest
index 4eb1711cd489..f9b8befeb032 100644
--- a/dev-python/flask-mongoengine/Manifest
+++ b/dev-python/flask-mongoengine/Manifest
@@ -1,3 +1,3 @@
DIST flask-mongoengine-1.0.0.gh.tar.gz 123516 BLAKE2B 5dd6cf1d774973ef1883d824bdf467b53306773eff5f7016f6440a7ec55648012755a1270b8fca0974aff00dfb189c0f3f7d6985a01c098729517c0018513c8b SHA512 bd95a8248a972a41c92dc2711f866420aabba56062322801e473e0b347c95ad47da39439992ba6cf23a0981c422ae84756af3af95d1171acd6b321f9cbc63085
-EBUILD flask-mongoengine-1.0.0.ebuild 947 BLAKE2B c3abc0cebdff45ea024c1922d6e209d9219d1b8c7fa22aba8af13fca28ca8701db08571072efc34d02eddc9ac8f7764fcf1fc1446b20de9a1bb57d551d6e63c7 SHA512 68800ed48aea7eed9cb2ba486f9d56dd45b790d6704306b44952cd797473713a3a3a2243e0770362a84cc51db7bb9340d39bfa68a99818c956ebef26d1b81120
+EBUILD flask-mongoengine-1.0.0.ebuild 1771 BLAKE2B 6c710e26ba5ad87ec17f50d86e15ed7c2a5f837b12db738071162a10719e9c87f6b2b3c51d874e18c7dffdd9d33573674f84e2f54dca271cd36fe569873f2eb5 SHA512 e21a5b17dbeca66056170401fc0d47343affcb828909c11482a30e7b1ccbe10ce6071e7ba196c8ea5c7d978eb2c001016b1226ba76eda9707ce2b2d799614d6c
MISC metadata.xml 355 BLAKE2B a5593b10b9a324da9a4240a118e6c72ded78aa7f724b5ecd4edb411e34bd6ac52bbff70c8af057b0ca2504d391eea7c79bd7c1f3bb57379e0d22fe2f6471e6ae SHA512 f8a3a52e7eea0421629f8c11b0497b9f273355419de501c5406804866b91e834fde3f7262100b18e52704cbf9fc63c224a77c0cd1ccbcb10ea08a2b353a3bacf
diff --git a/dev-python/flask-mongoengine/flask-mongoengine-1.0.0.ebuild b/dev-python/flask-mongoengine/flask-mongoengine-1.0.0.ebuild
index b2895daecb9c..333446b4453e 100644
--- a/dev-python/flask-mongoengine/flask-mongoengine-1.0.0.ebuild
+++ b/dev-python/flask-mongoengine/flask-mongoengine-1.0.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -14,13 +14,16 @@ SRC_URI="
LICENSE="BSD"
SLOT="0"
-KEYWORDS="amd64 x86"
-# TODO: make it spawn a local mongodb instance
-RESTRICT="test"
+KEYWORDS="amd64"
RDEPEND=">=dev-python/flask-1.1.2[${PYTHON_USEDEP}]
>=dev-python/mongoengine-0.20[${PYTHON_USEDEP}]
>=dev-python/flask-wtf-0.14.3[${PYTHON_USEDEP}]"
+BDEPEND="
+ test? (
+ dev-db/mongodb
+ dev-python/python-email-validator[${PYTHON_USEDEP}]
+ )"
distutils_enable_sphinx docs
distutils_enable_tests pytest
@@ -34,3 +37,38 @@ python_prepare_all() {
distutils-r1_python_prepare_all
}
+
+python_test() {
+ local dbpath=${TMPDIR}/mongo.db
+ local logpath=${TMPDIR}/mongod.log
+
+ mkdir -p "${dbpath}" || die
+ ebegin "Trying to start mongod on port ${DB_PORT}"
+
+ LC_ALL=C \
+ mongod --dbpath "${dbpath}" --nojournal \
+ --bind_ip 127.0.0.1 --port 27017 \
+ --unixSocketPrefix "${TMPDIR}" \
+ --logpath "${logpath}" --fork || die
+ sleep 2
+
+ # Now we need to check if the server actually started...
+ if [[ -S "${TMPDIR}"/mongodb-27017.sock ]]; then
+ # yay!
+ eend 0
+ else
+ eend 1
+ eerror "Unable to start mongod for tests. See the server log:"
+ eerror " ${logpath}"
+ die "Unable to start mongod for tests."
+ fi
+
+ local failed
+ nonfatal epytest || failed=1
+
+ mongod --dbpath "${dbpath}" --shutdown || die
+
+ [[ ${failed} ]] && die "Tests fail with ${EPYTHON}"
+
+ rm -rf "${dbpath}" || die
+}