aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/py3-inquirer/APKBUILD38
-rw-r--r--testing/py3-inquirer/disable-failing-tests.patch27
-rw-r--r--testing/py3-inquirer/loosen-deps.patch16
-rw-r--r--testing/py3-inquirer/use-py3-in-tests.patch105
4 files changed, 186 insertions, 0 deletions
diff --git a/testing/py3-inquirer/APKBUILD b/testing/py3-inquirer/APKBUILD
new file mode 100644
index 0000000000..c2096ef7c8
--- /dev/null
+++ b/testing/py3-inquirer/APKBUILD
@@ -0,0 +1,38 @@
+# Contributor: Rasmus Thomsen <oss@cogitri.dev>
+# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
+pkgname=py3-inquirer
+pkgver=2.6.3
+pkgrel=0
+pkgdesc="A collection of common interactive command line user interfaces"
+url="https://github.com/magmax/python-inquirer"
+arch="noarch"
+license="MIT"
+depends="python3 py3-blessings py3-readchar py3-python-editor"
+makedepends="py3-setuptools"
+checkdepends="py3-flake8 py3-pexpect py3-pytest py3-pytest-cov py3-pytest-xdist
+ py3-mock py3-nosexcover py3-coveralls py3-wheel ncurses-terminfo"
+# GH tarballs required for tests!
+source="$pkgname-$pkgver.tar.gz::https://github.com/magmax/python-inquirer/archive/$pkgver.tar.gz
+ loosen-deps.patch
+ use-py3-in-tests.patch
+ disable-failing-tests.patch"
+builddir="$srcdir/python-inquirer-$pkgver"
+
+build() {
+ python3 setup.py build
+}
+
+check() {
+ TERM=xterm-256color python3 setup.py test
+}
+
+package() {
+ python3 setup.py install --prefix=/usr --root="$pkgdir"
+ # Remove installed tests
+ rm -r "$pkgdir"/usr/lib/python*/site-packages/tests
+}
+
+sha512sums="8f1fd76a1e109040ef12ab519224f100f966515af7306dd61b8fa6579b9cbc6f835d741390ef1daa4a18f755a25599579d7bfd1b6f532b4cdba99a65058dcc12 py3-inquirer-2.6.3.tar.gz
+eea162938426f59d488422b956df611d5b074926c14ff024abffb905fb1af7a80ce705c981d4ad51c33890e00b64c935234bdaa65c2daa07b46a914526d11e8e loosen-deps.patch
+08cb9047bdbb04f27162eb58c3ad6dbf0905b7a320e02be07c117f351967aa0059b14923cbbd5e73192b5009e58b70555550d010e0a857dbb9c69277488111ba use-py3-in-tests.patch
+cbc376ae4f3200fbaa9b008a8c00ad264808421be2cccea08fb903f3dcf00a773a00ac0b928b71fc1e884b7341e73be38e79d32e4693fe263b635b0d4a6b6a7b disable-failing-tests.patch"
diff --git a/testing/py3-inquirer/disable-failing-tests.patch b/testing/py3-inquirer/disable-failing-tests.patch
new file mode 100644
index 0000000000..e8f42b7d95
--- /dev/null
+++ b/testing/py3-inquirer/disable-failing-tests.patch
@@ -0,0 +1,27 @@
+https://github.com/magmax/python-inquirer/issues/84
+diff --git a/tests/acceptance/test_list.py b/tests/acceptance/test_list.py
+index 82886e8..f6fa7e4 100644
+--- a/tests/acceptance/test_list.py
++++ b/tests/acceptance/test_list.py
+@@ -39,21 +39,6 @@ class ListCarouselTest(unittest.TestCase):
+ import sys
+ self.sut.logfile = sys.stdout
+
+- def test_out_of_bounds_up(self):
+- self.sut.send(key.UP)
+- self.sut.expect('Standard.*', timeout=1)
+- self.sut.send(key.ENTER)
+- self.sut.expect("{'size': 'Standard'}.*", timeout=1)
+-
+- def test_out_of_bounds_down(self):
+- for i in range(3):
+- self.sut.send(key.DOWN)
+- # Not looking at what we expect along the way,
+- # let the last "expect" check that we got the right result
+- self.sut.expect('>.*', timeout=1)
+- self.sut.send(key.ENTER)
+- self.sut.expect("{'size': 'Jumbo'}.*", timeout=1)
+-
+
+ class ListTaggedTest(unittest.TestCase):
+ def setUp(self):
diff --git a/testing/py3-inquirer/loosen-deps.patch b/testing/py3-inquirer/loosen-deps.patch
new file mode 100644
index 0000000000..528d8741a1
--- /dev/null
+++ b/testing/py3-inquirer/loosen-deps.patch
@@ -0,0 +1,16 @@
+diff --git a/setup.py b/setup.py
+index 43c4cab..d79ca61 100644
+--- a/setup.py
++++ b/setup.py
+@@ -68,8 +68,8 @@ setup(name='inquirer',
+ include_package_data=True,
+ zip_safe=False,
+ install_requires=[
+- 'blessings == 1.7',
+- 'readchar == 2.0.1',
+- 'python-editor==1.0.4'
++ 'blessings >=1.7<2',
++ 'readchar >=2<3',
++ 'python-editor >=1<2'
+ ],
+ )
diff --git a/testing/py3-inquirer/use-py3-in-tests.patch b/testing/py3-inquirer/use-py3-in-tests.patch
new file mode 100644
index 0000000000..cc984badcd
--- /dev/null
+++ b/testing/py3-inquirer/use-py3-in-tests.patch
@@ -0,0 +1,105 @@
+diff --git a/tests/acceptance/test_checkbox.py b/tests/acceptance/test_checkbox.py
+index fd84a7b..c0b1ad4 100644
+--- a/tests/acceptance/test_checkbox.py
++++ b/tests/acceptance/test_checkbox.py
+@@ -5,7 +5,7 @@ from readchar import key
+
+ class CheckTest(unittest.TestCase):
+ def setUp(self):
+- self.sut = pexpect.spawn('python examples/checkbox.py')
++ self.sut = pexpect.spawn('python3 examples/checkbox.py')
+ self.sut.expect('History.*', timeout=1)
+
+ def test_default_input(self):
+@@ -67,7 +67,7 @@ class CheckTest(unittest.TestCase):
+
+ class CheckWithTaggedValuesTest(unittest.TestCase):
+ def setUp(self):
+- self.sut = pexpect.spawn('python examples/checkbox_tagged.py')
++ self.sut = pexpect.spawn('python3 examples/checkbox_tagged.py')
+ self.sut.expect('History.*', timeout=1)
+
+ def test_default_selection(self):
+diff --git a/tests/acceptance/test_list.py b/tests/acceptance/test_list.py
+index 2aca650..82886e8 100644
+--- a/tests/acceptance/test_list.py
++++ b/tests/acceptance/test_list.py
+@@ -5,7 +5,7 @@ from readchar import key
+
+ class ListTest(unittest.TestCase):
+ def setUp(self):
+- self.sut = pexpect.spawn('python examples/list.py')
++ self.sut = pexpect.spawn('python3 examples/list.py')
+ self.sut.expect('Micro.*', timeout=1)
+
+ def test_default_input(self):
+@@ -34,7 +34,7 @@ class ListTest(unittest.TestCase):
+
+ class ListCarouselTest(unittest.TestCase):
+ def setUp(self):
+- self.sut = pexpect.spawn('python examples/list_carousel.py')
++ self.sut = pexpect.spawn('python3 examples/list_carousel.py')
+ self.sut.expect('Standard.*', timeout=1)
+ import sys
+ self.sut.logfile = sys.stdout
+@@ -57,7 +57,7 @@ class ListCarouselTest(unittest.TestCase):
+
+ class ListTaggedTest(unittest.TestCase):
+ def setUp(self):
+- self.sut = pexpect.spawn('python examples/list_tagged.py')
++ self.sut = pexpect.spawn('python3 examples/list_tagged.py')
+ self.sut.expect('Micro.*', timeout=1)
+
+ def test_default_input(self):
+diff --git a/tests/acceptance/test_password.py b/tests/acceptance/test_password.py
+index 6f9c102..0717222 100644
+--- a/tests/acceptance/test_password.py
++++ b/tests/acceptance/test_password.py
+@@ -5,7 +5,7 @@ from readchar import key
+
+ class PasswordTest(unittest.TestCase):
+ def setUp(self):
+- self.sut = pexpect.spawn('python examples/password.py')
++ self.sut = pexpect.spawn('python3 examples/password.py')
+
+ def test_default_input(self):
+ self.sut.expect(".*What's.*", timeout=1)
+diff --git a/tests/acceptance/test_pre_answers.py b/tests/acceptance/test_pre_answers.py
+index c9d84bc..5b4562a 100644
+--- a/tests/acceptance/test_pre_answers.py
++++ b/tests/acceptance/test_pre_answers.py
+@@ -14,7 +14,7 @@ expected_result = r"""\
+
+ class PreAnswersTest(unittest.TestCase):
+ def setUp(self):
+- self.sut = pexpect.spawn('python examples/pre_answers.py')
++ self.sut = pexpect.spawn('python3 examples/pre_answers.py')
+
+ def test_minimal_input(self):
+ # user
+diff --git a/tests/acceptance/test_shortcuts.py b/tests/acceptance/test_shortcuts.py
+index e6bf784..f4512de 100644
+--- a/tests/acceptance/test_shortcuts.py
++++ b/tests/acceptance/test_shortcuts.py
+@@ -5,7 +5,7 @@ from readchar import key
+
+ class ShortcutsTest(unittest.TestCase):
+ def setUp(self):
+- self.sut = pexpect.spawn('python examples/shortcuts.py')
++ self.sut = pexpect.spawn('python3 examples/shortcuts.py')
+
+ def set_username(self, name='foo'):
+ self.sut.expect("Enter your username", timeout=1)
+diff --git a/tests/acceptance/test_text.py b/tests/acceptance/test_text.py
+index 1eb3def..9eb47a7 100644
+--- a/tests/acceptance/test_text.py
++++ b/tests/acceptance/test_text.py
+@@ -6,7 +6,7 @@ from readchar import key
+
+ class TextTest(unittest.TestCase):
+ def setUp(self):
+- self.sut = pexpect.spawn('python examples/text.py')
++ self.sut = pexpect.spawn('python3 examples/text.py')
+
+ def set_name(self, name='foo'):
+ self.sut.expect("What's", timeout=1)