aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Polański <michal@polanski.me>2020-05-14 00:42:53 +0200
committerRasmus Thomsen <oss@cogitri.dev>2020-05-14 17:23:38 +0000
commit843915809150fe0ef3e094b83ed6eda8e1bf3415 (patch)
tree1f0c01cc66e0c09a234fa5bfcfaf1d9e5d188d88
parente1514f27200206a69e9eabb9b902580f13ccd58d (diff)
testing/py3-pykwalify: add patches and enable tests
-rw-r--r--testing/py3-pykwalify/APKBUILD16
-rw-r--r--testing/py3-pykwalify/fix-duplicate-key-error.patch22
-rw-r--r--testing/py3-pykwalify/fix-unexpected-keyword-arguments.patch25
3 files changed, 59 insertions, 4 deletions
diff --git a/testing/py3-pykwalify/APKBUILD b/testing/py3-pykwalify/APKBUILD
index 5296ba67397..b10ba6440b1 100644
--- a/testing/py3-pykwalify/APKBUILD
+++ b/testing/py3-pykwalify/APKBUILD
@@ -3,22 +3,30 @@
pkgname=py3-pykwalify
_pkgname=pykwalify
pkgver=1.7.0
-pkgrel=0
+pkgrel=1
pkgdesc="Python YAML/JSON schema validation library"
url="https://github.com/Grokzen/pykwalify"
arch="noarch"
license="MIT"
depends="python3 py3-setuptools py3-docopt py3-ruamel.yaml py3-dateutil"
-options="!check" # requires testfixtures (needs packaging)
-source="$_pkgname-$pkgver.tar.gz::https://github.com/Grokzen/pykwalify/archive/$pkgver.tar.gz"
+checkdepends="py3-pytest py3-testfixtures"
+source="$_pkgname-$pkgver.tar.gz::https://github.com/Grokzen/pykwalify/archive/$pkgver.tar.gz
+ fix-duplicate-key-error.patch
+ fix-unexpected-keyword-arguments.patch"
builddir="$srcdir/$_pkgname-$pkgver"
build() {
python3 setup.py build
}
+check() {
+ pytest
+}
+
package() {
python3 setup.py install --prefix=/usr --root="$pkgdir" --skip-build
}
-sha512sums="484922ba921462aaf0607811e0f36c9cae6f67682d8d0c408066381d21a247fb156c17b8440da207d58e127a4a8adb85b18e63fe3b4142368bfd21fa644a7bc7 pykwalify-1.7.0.tar.gz"
+sha512sums="484922ba921462aaf0607811e0f36c9cae6f67682d8d0c408066381d21a247fb156c17b8440da207d58e127a4a8adb85b18e63fe3b4142368bfd21fa644a7bc7 pykwalify-1.7.0.tar.gz
+3c8b5e9e37b78da937193e49f7be5ab95878cc4319992b74efb845286666eccea792e15eb47d8c144d22ef3f646585e4516735dd52b50a2c4af5f90abe6bc9b5 fix-duplicate-key-error.patch
+e6a72aef8343c6af40cdb9d9748c1bc3fb0d34fc20822cec498291ad7d942d63cf3a498e406e194770aaed6fd423f308c348d8723d4136baa05e7af5606f6e02 fix-unexpected-keyword-arguments.patch"
diff --git a/testing/py3-pykwalify/fix-duplicate-key-error.patch b/testing/py3-pykwalify/fix-duplicate-key-error.patch
new file mode 100644
index 00000000000..b4b9f10bac6
--- /dev/null
+++ b/testing/py3-pykwalify/fix-duplicate-key-error.patch
@@ -0,0 +1,22 @@
+From 744816a146e567a4c1efd30e874ff76134754fe2 Mon Sep 17 00:00:00 2001
+From: Grokzen <Grokzen@gmail.com>
+Date: Wed, 9 Oct 2019 23:25:59 +0200
+Subject: [PATCH] Fix broken test where errors data was wrong and duplicated
+
+---
+ tests/files/fail/test_type_float.yaml | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/tests/files/fail/test_type_float.yaml b/tests/files/fail/test_type_float.yaml
+index bef14b8..972167d 100644
+--- a/tests/files/fail/test_type_float.yaml
++++ b/tests/files/fail/test_type_float.yaml
+@@ -16,8 +16,6 @@ schema:
+ type: seq
+ seq:
+ - type: float
+-errors:
+- - "Value 'foo' is not of type 'float'. Path: '/0'"
+ errors:
+ - "Value 'True' is not of type 'float'. Path: '/1'"
+ - "Value 'foo' is not of type 'float'. Path: '/0'"
diff --git a/testing/py3-pykwalify/fix-unexpected-keyword-arguments.patch b/testing/py3-pykwalify/fix-unexpected-keyword-arguments.patch
new file mode 100644
index 00000000000..89c1304f56c
--- /dev/null
+++ b/testing/py3-pykwalify/fix-unexpected-keyword-arguments.patch
@@ -0,0 +1,25 @@
+From 49052dd010637e1403c8b2b1c3710926acd2b1a0 Mon Sep 17 00:00:00 2001
+From: Grokzen <Grokzen@gmail.com>
+Date: Wed, 9 Oct 2019 23:21:09 +0200
+Subject: [PATCH] Fixed bug in test_multi_file_support where pytest would raise
+ issue with a option that is no longer supported
+
+---
+ tests/test_core.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test_core.py b/tests/test_core.py
+index 6fcd81e..bd974df 100644
+--- a/tests/test_core.py
++++ b/tests/test_core.py
+@@ -336,7 +336,9 @@ def test_multi_file_support(self):
+ compare(c.root_rule.schema_str, passing_test[2], prefix="Parsed rules is not correct, something have changed...")
+
+ for failing_test in failing_tests:
+- with pytest.raises(failing_test[2], message="Test files: {0} : {1}".format(", ".join(failing_test[0]), failing_test[1])):
++ print("Test files: {0} : {1}".format(", ".join(failing_test[0]), failing_test[1]))
++
++ with pytest.raises(failing_test[2]):
+ c = Core(schema_files=failing_test[0], source_file=failing_test[1])
+ c.validate()
+