dev-python/dbusmock: New package for easily running tests by D-Bus requiring software
authorMart Raudsepp <leio@gentoo.org>
Sun, 28 May 2017 15:15:02 +0000 (18:15 +0300)
committerMart Raudsepp <leio@gentoo.org>
Sun, 28 May 2017 15:24:07 +0000 (18:24 +0300)
Needed by gnome-settings-daemon power plugin tests

dev-python/dbusmock/Manifest [new file with mode: 0644]
dev-python/dbusmock/dbusmock-0.16.7.ebuild [new file with mode: 0644]
dev-python/dbusmock/files/0.16.7-disable-pyflakes-test.patch [new file with mode: 0644]
dev-python/dbusmock/metadata.xml [new file with mode: 0644]

diff --git a/dev-python/dbusmock/Manifest b/dev-python/dbusmock/Manifest
new file mode 100644 (file)
index 0000000..456da5e
--- /dev/null
@@ -0,0 +1 @@
+DIST dbusmock-0.16.7.tar.gz 70544 SHA256 2d2ea892fa4633c3ec6ac1e912120ec493047a5c6522849b7d1c95ad755bce75 SHA512 749728b966b1e067a0a8bd61ee64c1c7ff22751ccb48e15096d041e78c6e779d787160ee191e90daa3177b92c0ee45c66af74b2dd4e4bcb570892b431ec13467 WHIRLPOOL 921c47fb0b86a6a3368c3b37c27f30b75edacefb46f1a726e39f35eb7b1ea7d0f78c3a7e04b218016c558578625ff28188bfece7cbc7aa06405effe4ab614f92
diff --git a/dev-python/dbusmock/dbusmock-0.16.7.ebuild b/dev-python/dbusmock/dbusmock-0.16.7.ebuild
new file mode 100644 (file)
index 0000000..7eebfd8
--- /dev/null
@@ -0,0 +1,45 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+PYTHON_REQ_USE="xml(+)"
+
+inherit distutils-r1
+
+MY_PN="python-${PN}"
+MY_P="${MY_PN}-${PV}"
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="Easily create mock objects on D-Bus for software testing"
+HOMEPAGE="https://github.com/martinpitt/python-dbusmock"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-3+"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="test"
+
+RDEPEND="
+       dev-python/dbus-python[${PYTHON_USEDEP}]
+       dev-python/pygobject:3[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+       >=dev-python/setuptools-17.1[${PYTHON_USEDEP}]
+       test? (
+               dev-python/nose[${PYTHON_USEDEP}]
+       )"
+
+PATCHES=(
+       "${FILESDIR}"/${PV}-disable-pyflakes-test.patch
+)
+
+python_test() {
+       nosetests --verbose || die "tests fail under ${EPYTHON}"
+}
+
+python_install_all() {
+       local DOCS=( NEWS README.rst )
+
+       distutils-r1_python_install_all
+}
diff --git a/dev-python/dbusmock/files/0.16.7-disable-pyflakes-test.patch b/dev-python/dbusmock/files/0.16.7-disable-pyflakes-test.patch
new file mode 100644 (file)
index 0000000..160003c
--- /dev/null
@@ -0,0 +1,20 @@
+https://github.com/martinpitt/python-dbusmock/issues/28
+
+--- a/tests/test_code.orig
++++ b/tests/test_code.py
+@@ -17,6 +17,7 @@
+ 
+ 
+ class StaticCodeTests(unittest.TestCase):
++    """
+     @unittest.skipIf(subprocess.call(['which', 'pyflakes'],
+                                      stdout=subprocess.PIPE) != 0,
+                      'pyflakes not installed')
+@@ -25,6 +26,7 @@
+                                     universal_newlines=True)
+         (out, err) = pyflakes.communicate()
+         self.assertEqual(pyflakes.returncode, 0, out)
++    """
+ 
+     @unittest.skipIf(subprocess.call(['which', 'pep8'],
+                                      stdout=subprocess.PIPE) != 0,
diff --git a/dev-python/dbusmock/metadata.xml b/dev-python/dbusmock/metadata.xml
new file mode 100644 (file)
index 0000000..996e7ca
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <maintainer type="project">
+               <email>gnome@gentoo.org</email>
+               <name>Gentoo GNOME Desktop</name>
+       </maintainer>
+</pkgmetadata>