From 1620e90a153a6cd284a03903abfd9710a2357335 Mon Sep 17 00:00:00 2001 From: Kamil Páral Date: Jun 26 2018 10:36:26 +0000 Subject: fix traceback in test_api.py during build --- diff --git a/0003-Fix-tests_api-list-traceback.patch b/0003-Fix-tests_api-list-traceback.patch new file mode 100644 index 0000000..77cc629 --- /dev/null +++ b/0003-Fix-tests_api-list-traceback.patch @@ -0,0 +1,27 @@ +commit dfd60ce7c656d95afc2e7c4c1e03be2982cc9a9d +Author: Kamil Páral +Date: Tue Jun 26 12:06:37 2018 +0200 + + test_api: fix traceback + + This is fixed: + ``` + Traceback (most recent call last): + File "/builddir/build/BUILD/flask-restful-0.3.6/tests/test_api.py", line 787, in test_fr_405 + set(['HEAD', 'OPTIONS'] + HelloWorld.methods)) + TypeError: can only concatenate list (not "set") to list + ``` + +diff --git a/tests/test_api.py b/tests/test_api.py +index 26447ae..f34b3f6 100644 +--- a/tests/test_api.py ++++ b/tests/test_api.py +@@ -784,7 +784,7 @@ class APITestCase(unittest.TestCase): + allow = ', '.join(set(resp.headers.get_all('Allow'))) + allow = set(method.strip() for method in allow.split(',')) + self.assertEquals(allow, +- set(['HEAD', 'OPTIONS'] + HelloWorld.methods)) ++ set(['HEAD', 'OPTIONS'] + list(HelloWorld.methods))) + + def test_exception_header_forwarded(self): + """Test that HTTPException's headers are extended properly""" diff --git a/python-flask-restful.spec b/python-flask-restful.spec index fc666cf..4da7480 100644 --- a/python-flask-restful.spec +++ b/python-flask-restful.spec @@ -13,7 +13,7 @@ Name: python-%{srcname} Version: 0.3.6 -Release: 6%{?dist} +Release: 7%{?dist} Summary: %{sum} Group: Development/Languages @@ -23,6 +23,9 @@ Source0: https://github.com/%{srcname}/%{srcname}/archive/%{version}.tar. Patch0: python-flask-restful.remove_q0_testcase.patch Patch1: 0001-Fix-arguments-with-type-list-705.patch Patch2: 0002-Support-aniso8601-3.0-in-tests.patch +# https://github.com/flask-restful/flask-restful/pull/762 +# should be hopefully merged into release > 0.3.6 +Patch3: 0003-Fix-tests_api-list-traceback.patch BuildArch: noarch # those are needed for tests: @@ -112,6 +115,7 @@ rm -rf docs/_themes/.gitignore %patch0 %patch1 %patch2 +%patch3 -p1 %build %py2_build @@ -144,6 +148,9 @@ rm -rf docs/_themes/.gitignore %endif %changelog +* Tue Jun 26 2018 Kamil Páral - 0.3.6-7 +- Add Patch3 to fix tests + * Tue Jun 19 2018 Miro Hrončok - 0.3.6-6 - Rebuilt for Python 3.7