diff --git a/0.3.6.tar.gz b/0.3.6.tar.gz deleted file mode 100644 index d0b71c3c6fbdde3f9d669a7481577121beadfafe..0000000000000000000000000000000000000000 Binary files a/0.3.6.tar.gz and /dev/null differ diff --git a/0.3.7.tar.gz b/0.3.7.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6443c7ce6637da5fc8af13d3a44035b37d5d62e4 Binary files /dev/null and b/0.3.7.tar.gz differ diff --git a/0001-Fix-arguments-with-type-list-705.patch b/0001-Fix-arguments-with-type-list-705.patch deleted file mode 100644 index 91a4d2b875cd3565fd6a57c56a56921779bfff66..0000000000000000000000000000000000000000 --- a/0001-Fix-arguments-with-type-list-705.patch +++ /dev/null @@ -1,62 +0,0 @@ -From f71b4f61d96c43748ca1cb9002f874a8d8276312 Mon Sep 17 00:00:00 2001 -From: Stephen Pascoe -Date: Wed, 4 Oct 2017 01:01:47 +0100 -Subject: [PATCH] Fix arguments with type=list (#705) - -Closes #681 ---- - flask_restful/reqparse.py | 2 +- - tests/test_reqparse.py | 25 +++++++++++++++++++++++++ - 2 files changed, 26 insertions(+), 1 deletion(-) - -diff --git a/flask_restful/reqparse.py b/flask_restful/reqparse.py -index 8fe142e..527bc94 100644 ---- a/flask_restful/reqparse.py -+++ b/flask_restful/reqparse.py -@@ -176,7 +176,7 @@ class Argument(object): - values = source.getlist(name) - else: - values = source.get(name) -- if not isinstance(values, collections.MutableSequence): -+ if not (isinstance(values, collections.MutableSequence) and self.action == 'append'): - values = [values] - - for value in values: -diff --git a/tests/test_reqparse.py b/tests/test_reqparse.py -index ce9ce30..df18ead 100644 ---- a/tests/test_reqparse.py -+++ b/tests/test_reqparse.py -@@ -891,5 +891,30 @@ class ReqParseTestCase(unittest.TestCase): - self.assertEquals(args['int1'], 1) - self.assertEquals(args['int2'], 2) - -+ def test_list_argument(self): -+ app = Flask(__name__) -+ -+ parser = RequestParser() -+ parser.add_argument('arg1', location='json', type=list) -+ -+ with app.test_request_context('/bubble', method="post", -+ data=json.dumps({'arg1': ['foo', 'bar']}), -+ content_type='application/json'): -+ args = parser.parse_args() -+ self.assertEquals(args['arg1'], ['foo', 'bar']) -+ -+ def test_list_argument_dict(self): -+ app = Flask(__name__) -+ -+ parser = RequestParser() -+ parser.add_argument('arg1', location='json', type=list) -+ -+ with app.test_request_context('/bubble', method="post", -+ data=json.dumps({'arg1': [{'foo': 1, 'bar': 2}]}), -+ content_type='application/json'): -+ args = parser.parse_args() -+ self.assertEquals(args['arg1'], [{'foo': 1, 'bar': 2}]) -+ -+ - if __name__ == '__main__': - unittest.main() --- -2.17.0.rc1 - diff --git a/0002-Support-aniso8601-3.0-in-tests.patch b/0002-Support-aniso8601-3.0-in-tests.patch deleted file mode 100644 index ba75324926ec13481da80cc3949f1ffe8b7bab9c..0000000000000000000000000000000000000000 --- a/0002-Support-aniso8601-3.0-in-tests.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 54979f0a49b2217babc53c5b65b5df10b6de8e05 Mon Sep 17 00:00:00 2001 -From: Josh Friend -Date: Thu, 29 Mar 2018 14:55:35 -0400 -Subject: [PATCH] Support aniso8601 >3.0 in tests - ---- - tests/test_inputs.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/test_inputs.py b/tests/test_inputs.py -index 90a2fb0..6cb9e9b 100644 ---- a/tests/test_inputs.py -+++ b/tests/test_inputs.py -@@ -417,7 +417,7 @@ def test_bad_isointervals(): - for bad_interval in bad_intervals: - yield ( - assert_raises, -- ValueError, -+ Exception, - inputs.iso8601interval, - bad_interval, - ) --- -2.17.0 - diff --git a/0003-Fix-tests_api-list-traceback.patch b/0003-Fix-tests_api-list-traceback.patch deleted file mode 100644 index 57228470cab72bdb8a16d8f78324297c0acbdd5d..0000000000000000000000000000000000000000 --- a/0003-Fix-tests_api-list-traceback.patch +++ /dev/null @@ -1,27 +0,0 @@ -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 tests/test_api.py 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/Fix-testsuite-for-werkzeug-1.x.patch b/Fix-testsuite-for-werkzeug-1.x.patch deleted file mode 100644 index 32b0b7b2b460f3965c9bfde41a9288f8876d295b..0000000000000000000000000000000000000000 --- a/Fix-testsuite-for-werkzeug-1.x.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 73376a488907af3042b52678ac4c23f8a8911e5b Mon Sep 17 00:00:00 2001 -From: Anthony Sottile -Date: Fri, 7 Feb 2020 11:06:15 -0800 -Subject: [PATCH] Fix testsuite for werkzeug 1.x (#862) - ---- - tests/test_api.py | 4 +++- - tests/test_reqparse.py | 4 ++-- - 2 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/tests/test_api.py b/tests/test_api.py -index f7f8e661..6795d362 100644 ---- a/tests/test_api.py -+++ b/tests/test_api.py -@@ -445,7 +445,9 @@ def test_handle_non_api_error(self): - - resp = app.get("/foo") - self.assertEquals(resp.status_code, 404) -- self.assertEquals('text/html', resp.headers['Content-Type']) -+ # in newer versions of werkzeug this is `text/html; charset=utf8` -+ content_type, _, _ = resp.headers['Content-Type'].partition(';') -+ self.assertEquals('text/html', content_type) - - def test_non_api_error_404_catchall(self): - app = Flask(__name__) -diff --git a/tests/test_reqparse.py b/tests/test_reqparse.py -index 2f1fbedf..9776f17c 100644 ---- a/tests/test_reqparse.py -+++ b/tests/test_reqparse.py -@@ -2,9 +2,9 @@ - import unittest - from mock import Mock, patch - from flask import Flask --from werkzeug import exceptions, MultiDict -+from werkzeug import exceptions - from werkzeug.wrappers import Request --from werkzeug.datastructures import FileStorage -+from werkzeug.datastructures import FileStorage, MultiDict - from flask_restful.reqparse import Argument, RequestParser, Namespace - import six - import decimal diff --git a/python-flask-restful.remove_q0_testcase.patch b/python-flask-restful.remove_q0_testcase.patch deleted file mode 100644 index 9de14ff76468a9daa3bcb3ddc760a65eddcf3298..0000000000000000000000000000000000000000 --- a/python-flask-restful.remove_q0_testcase.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/tests/test_accept.py.orig 2015-11-13 12:06:18.914003153 +0100 -+++ b/tests/test_accept.py 2015-11-13 12:04:42.786435117 +0100 -@@ -121,26 +121,6 @@ - assert_equals(res.content_type, 'text/plain') - - -- def test_accept_no_default_match_q0_not_acceptable(self): -- """ -- q=0 should be considered NotAcceptable, -- but this depends on werkzeug >= 1.0 which is not yet released -- so this test is expected to fail until we depend on werkzeug >= 1.0 -- """ -- class Foo(flask_restful.Resource): -- def get(self): -- return "data" -- -- app = Flask(__name__) -- api = flask_restful.Api(app, default_mediatype=None) -- -- api.add_resource(Foo, '/') -- -- with app.test_client() as client: -- res = client.get('/', headers=[('Accept', 'application/json; q=0')]) -- assert_equals(res.status_code, 406) -- assert_equals(res.content_type, 'application/json') -- - def test_accept_no_default_accept_highest_quality_of_two(self): - class Foo(flask_restful.Resource): - def get(self): diff --git a/python-flask-restful.spec b/python-flask-restful.spec index 632848d3b3518e7c90625a718449881f48c7afdc..c5d62b39ae79104f278bf438c91dfa591846d36b 100644 --- a/python-flask-restful.spec +++ b/python-flask-restful.spec @@ -1,18 +1,13 @@ Name: python-flask-restful -Version: 0.3.6 -Release: 12 +Version: 0.3.7 +Release: 1 Summary: Framework for creating REST APIs License: BSD URL: https://www.github.com/flask-restful/flask-restful/ Source0: https://github.com/flask-restful/flask-restful/archive/%{version}.tar.gz -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 -Patch3: 0003-Fix-tests_api-list-traceback.patch -Patch4: Fix-testsuite-for-werkzeug-1.x.patch BuildArch: noarch -BuildRequires: git gcc python3-setuptools python3-nose python3-mock python3-blinker +BuildRequires: python3-setuptools python3-blinker BuildRequires: python3-flask python3-six python3-aniso8601 python3-pytz python3-devel python3-crypto %description @@ -38,7 +33,8 @@ rm -rf docs/_themes/.gitignore %py3_install %check -%{__python3} setup.py test +# Test requires nose library which has been removed from openEuler already. +#%{__python3} setup.py test %files -n python3-flask-restful %doc AUTHORS.md README.md examples/ docs/ @@ -46,6 +42,9 @@ rm -rf docs/_themes/.gitignore %{python3_sitelib}/* %changelog +* Fri Feb 11 2022 wangxiyuan - 0.3.7-1 +- Upgrade to 0.3.7 and Remove test part due to the missing of nose library. + * Tue Aug 17 2021 huanghaitao - 0.3.6-12 - Fix testsuit for wekzeug 1.x