aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Barbieri <lssndrbarbieri@gmail.com>2021-09-26 19:30:36 +0200
committerAlessandro Barbieri <lssndrbarbieri@gmail.com>2021-09-26 20:37:09 +0200
commitf3e3736f648ce6f3cecbbf13147063fd21cbebdb (patch)
tree4e42e6c12ca3b0bc859d0c26459da42989477f9b /dev-python/pifpaf
parentdev-python/daiquiri: initial import (diff)
downloadguru-f3e3736f648ce6f3cecbbf13147063fd21cbebdb.tar.gz
guru-f3e3736f648ce6f3cecbbf13147063fd21cbebdb.tar.bz2
guru-f3e3736f648ce6f3cecbbf13147063fd21cbebdb.zip
dev-python/pifpaf: initial import
Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
Diffstat (limited to 'dev-python/pifpaf')
-rw-r--r--dev-python/pifpaf/Manifest1
-rw-r--r--dev-python/pifpaf/files/testrepository-0.0.20-test-backport.patch62
-rw-r--r--dev-python/pifpaf/files/testrepository-0.0.20-test-backport1.patch16
-rw-r--r--dev-python/pifpaf/files/testrepository-0.0.20-test-backport2.patch49
-rw-r--r--dev-python/pifpaf/metadata.xml15
-rw-r--r--dev-python/pifpaf/pifpaf-3.1.5.ebuild42
6 files changed, 185 insertions, 0 deletions
diff --git a/dev-python/pifpaf/Manifest b/dev-python/pifpaf/Manifest
new file mode 100644
index 000000000..11ae766bb
--- /dev/null
+++ b/dev-python/pifpaf/Manifest
@@ -0,0 +1 @@
+DIST pifpaf-3.1.5.tar.gz 189903 BLAKE2B 5742e995feeb91af41db20cc605e8a5f5f21f63281d4f66ba8b108310a88d716ab4be0a43e0371f10e7f3f42b693953b3344c648458999348b914e03abe462c8 SHA512 4e0f70740f8260cb3cf801ea97f1fa30e6b87cfc4112b5482389d0635e76bbc7f1561945397e4e6586116c49d11b1e8f721dd61dca82668833bf224f9ba3e94f
diff --git a/dev-python/pifpaf/files/testrepository-0.0.20-test-backport.patch b/dev-python/pifpaf/files/testrepository-0.0.20-test-backport.patch
new file mode 100644
index 000000000..d7ab87c06
--- /dev/null
+++ b/dev-python/pifpaf/files/testrepository-0.0.20-test-backport.patch
@@ -0,0 +1,62 @@
+From 8f8ab15fafdad6db850c84772323b32375b09285 Mon Sep 17 00:00:00 2001
+From: Robert Collins <robertc@robertcollins.net>
+Date: Tue, 10 Mar 2015 15:21:49 +1300
+Subject: [PATCH] Fixup tests with latest testtools.
+
+Testtools has started chunking exceptions (which is perhaps good,
+perhaps bad) - but we shouldn't depend on the exact behaviour in it
+for our tests.
+--- a/NEWS
++++ b/NEWS
+@@ -5,6 +5,12 @@ testrepository release notes
+ NEXT (In development)
+ +++++++++++++++++++++
+
++CHANGES
++-------
++
++* Isolate the testrepository test suite from the chunking (or otherwise)
++ behaviour of testtools' exception handlers. (Robert Collins)
++
+ 0.0.20
+ ++++++
+
+--- a/testrepository/tests/test_repository.py
++++ b/testrepository/tests/test_repository.py
+@@ -28,6 +28,7 @@
+ from testresources import TestResource
+ from testtools import (
+ clone_test_with_new_id,
++ content,
+ PlaceHolder,
+ )
+ import testtools
+@@ -103,19 +104,24 @@ class Case(ResourcedTestCase):
+ def passing(self):
+ pass
+
+- def failing(self):
+- self.fail("oops")
+-
+ def unexpected_success(self):
+ self.expectFailure("unexpected success", self.assertTrue, True)
+
+
++class FailingCase:
++
++ def run(self, result):
++ result.startTest(self)
++ result.addError(
++ self, None, details={'traceback': content.text_content("")})
++ result.stopTest(self)
++
+ def make_test(id, should_pass):
+ """Make a test."""
+ if should_pass:
+ case = Case("passing")
+ else:
+- case = Case("failing")
++ case = FailingCase()
+ return clone_test_with_new_id(case, id)
+
+
diff --git a/dev-python/pifpaf/files/testrepository-0.0.20-test-backport1.patch b/dev-python/pifpaf/files/testrepository-0.0.20-test-backport1.patch
new file mode 100644
index 000000000..655d2c3e7
--- /dev/null
+++ b/dev-python/pifpaf/files/testrepository-0.0.20-test-backport1.patch
@@ -0,0 +1,16 @@
+From d3d6cac4fd42f2067c0dd81be748853f81c348fc Mon Sep 17 00:00:00 2001
+From: Robert Collins <robertc@robertcollins.net>
+Date: Sun, 12 Jul 2015 21:37:34 +1200
+Subject: [PATCH] Fix 3.3+ tests with nested classnames.
+
+--- a/testrepository/tests/ui/test_cli.py
++++ b/testrepository/tests/ui/test_cli.py
+@@ -157,7 +157,7 @@ def method(self):
+ self.assertThat(ui._stdout.buffer.getvalue().decode('utf8'),
+ DocTestMatches("""\
+ ======================================================================
+-FAIL: testrepository.tests.ui.test_cli.Case.method
++FAIL: testrepository.tests.ui.test_cli...Case.method
+ ----------------------------------------------------------------------
+ ...Traceback (most recent call last):...
+ File "...test_cli.py", line ..., in method
diff --git a/dev-python/pifpaf/files/testrepository-0.0.20-test-backport2.patch b/dev-python/pifpaf/files/testrepository-0.0.20-test-backport2.patch
new file mode 100644
index 000000000..69d591c2f
--- /dev/null
+++ b/dev-python/pifpaf/files/testrepository-0.0.20-test-backport2.patch
@@ -0,0 +1,49 @@
+From e2f84ae6b2bcf89221613056d0c45dd308f46d62 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= <jelmer@jelmer.uk>
+Date: Thu, 5 Apr 2018 01:02:40 +0100
+Subject: [PATCH] Fix the testrepository tests with newer versions of
+ testtools.
+
+--- a/testrepository/tests/commands/test_failing.py
++++ b/testrepository/tests/commands/test_failing.py
+@@ -90,7 +90,7 @@ class TestCommand(ResourcedTestCase):
+ finally:
+ log.stopTestRun()
+ self.assertEqual(
+- log._events, [
++ [tuple(ev) for ev in log._events], [
+ ('startTestRun',),
+ ('status', 'failing', 'inprogress', None, True, None, None, False,
+ None, None, Wildcard),
+--- a/testrepository/tests/test_repository.py
++++ b/testrepository/tests/test_repository.py
+@@ -113,9 +113,10 @@ class FailingCase:
+ def run(self, result):
+ result.startTest(self)
+ result.addError(
+- self, None, details={'traceback': content.text_content("")})
++ self, None, details={'traceback': content.text_content("tb")})
+ result.stopTest(self)
+
++
+ def make_test(id, should_pass):
+ """Make a test."""
+ if should_pass:
+@@ -409,7 +410,7 @@ class TestRepositoryContract(ResourcedTestCase):
+ finally:
+ log.stopTestRun()
+ self.assertEqual(
+- log._events, [
++ [tuple(ev) for ev in log._events], [
+ ('startTestRun',),
+ ('status',
+ 'testrepository.tests.test_repository.Case.method',
+@@ -465,7 +466,7 @@ class TestRepositoryContract(ResourcedTestCase):
+ finally:
+ log.stopTestRun()
+ self.assertEqual(
+- log._events,
++ [tuple(ev) for ev in log._events],
+ [
+ ('startTestRun',),
+ ('status',
diff --git a/dev-python/pifpaf/metadata.xml b/dev-python/pifpaf/metadata.xml
new file mode 100644
index 000000000..ce63cf84c
--- /dev/null
+++ b/dev-python/pifpaf/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>lssndrbarbieri@gmail.com</email>
+ <name>Alessandro Barbieri</name>
+ </maintainer>
+ <longdescription lang="en">
+Pifpaf is a suite of fixtures and a command-line tool that allows to start and stop daemons for a quick throw-away usage. This is typically useful when needing these daemons to run integration testing. It originaly evolved from its precussor overtest.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">jd/pifpaf</remote-id>
+ <remote-id type="pypi">pifpaf</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-python/pifpaf/pifpaf-3.1.5.ebuild b/dev-python/pifpaf/pifpaf-3.1.5.ebuild
new file mode 100644
index 000000000..204ad2584
--- /dev/null
+++ b/dev-python/pifpaf/pifpaf-3.1.5.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+EPYTEST_DESELECT=( pifpaf/tests/test_cli.py::TestCli::test_non_existing_command )
+PYTHON_COMPAT=( python3_8 )
+
+inherit distutils-r1
+
+DESCRIPTION="Python fixtures and daemon managing tools for functional testing"
+HOMEPAGE="
+ https://pypi.org/project/pifpaf
+ https://github.com/jd/pifpaf
+"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="
+ dev-python/daiquiri[${PYTHON_USEDEP}]
+ dev-python/click[${PYTHON_USEDEP}]
+ dev-python/pbr[${PYTHON_USEDEP}]
+ dev-python/jinja[${PYTHON_USEDEP}]
+ dev-python/fixtures[${PYTHON_USEDEP}]
+ dev-python/psutil[${PYTHON_USEDEP}]
+ dev-python/pyxattr[${PYTHON_USEDEP}]
+"
+DEPEND="
+ ${RDEPEND}
+ dev-python/pbr[${PYTHON_USEDEP}]
+ test? (
+ dev-python/requests[${PYTHON_USEDEP}]
+ dev-python/testrepository[${PYTHON_USEDEP}]
+ dev-python/testtools[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ )
+"
+
+distutils_enable_tests pytest