Commit 84391580 authored by Michał Polański's avatar Michał Polański Committed by Rasmus Thomsen

testing/py3-pykwalify: add patches and enable tests

parent e1514f27
......@@ -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"
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'"
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()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment