From b7c0af9118441115a7e895100d766d0549e25cc028100898ba7d00ec32d5541c Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 23 Jun 2021 08:31:18 +0000 Subject: [PATCH] - Modify werkzeug.patch to support Werkzeug 2.0, update Requires. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-httpbin?expand=0&rev=17 --- python-httpbin.changes | 5 ++++ python-httpbin.spec | 6 ++--- werkzeug.patch | 54 +++++++++++++++++++++++++++++++++++++----- 3 files changed, 56 insertions(+), 9 deletions(-) diff --git a/python-httpbin.changes b/python-httpbin.changes index 06fbbc7..cf76fb6 100644 --- a/python-httpbin.changes +++ b/python-httpbin.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jun 23 08:30:27 UTC 2021 - Steve Kowalik + +- Modify werkzeug.patch to support Werkzeug 2.0, update Requires. + ------------------------------------------------------------------- Tue May 28 11:12:45 UTC 2019 - Tomáš Chvátal diff --git a/python-httpbin.spec b/python-httpbin.spec index 7f313f3..44f89ba 100644 --- a/python-httpbin.spec +++ b/python-httpbin.spec @@ -1,7 +1,7 @@ # # spec file for package python-httpbin # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -30,7 +30,7 @@ Patch0: werkzeug.patch BuildRequires: %{python_module Brotli} BuildRequires: %{python_module Flask} BuildRequires: %{python_module MarkupSafe} -BuildRequires: %{python_module Werkzeug >= 0.14.1} +BuildRequires: %{python_module Werkzeug >= 2.0} BuildRequires: %{python_module blinker} BuildRequires: %{python_module decorator} BuildRequires: %{python_module flasgger} @@ -44,7 +44,7 @@ BuildRequires: python-rpm-macros Requires: python-Brotli Requires: python-Flask Requires: python-MarkupSafe -Requires: python-Werkzeug >= 0.14.1 +Requires: python-Werkzeug >= 2.0 Requires: python-blinker Requires: python-decorator Requires: python-flasgger diff --git a/werkzeug.patch b/werkzeug.patch index 1eba5c6..84d5fbf 100644 --- a/werkzeug.patch +++ b/werkzeug.patch @@ -12,11 +12,11 @@ Subject: [PATCH] fix #554: update tests, Pipfile, Pipfile.lock for test_httpbin.py | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) -diff --git a/test_httpbin.py b/test_httpbin.py -index b7104ffc..ea51ae81 100755 ---- a/test_httpbin.py -+++ b/test_httpbin.py -@@ -148,7 +148,6 @@ def test_get(self): +Index: python-httpbin-0.7.0+git20181107.f8ec666/test_httpbin.py +=================================================================== +--- python-httpbin-0.7.0+git20181107.f8ec666.orig/test_httpbin.py ++++ python-httpbin-0.7.0+git20181107.f8ec666/test_httpbin.py +@@ -148,7 +148,6 @@ class HttpbinTestCase(unittest.TestCase) data = json.loads(response.data.decode('utf-8')) self.assertEqual(data['args'], {}) self.assertEqual(data['headers']['Host'], 'localhost') @@ -24,7 +24,7 @@ index b7104ffc..ea51ae81 100755 self.assertEqual(data['headers']['User-Agent'], 'test') # self.assertEqual(data['origin'], None) self.assertEqual(data['url'], 'http://localhost/get') -@@ -162,7 +161,6 @@ def test_anything(self): +@@ -162,7 +161,6 @@ class HttpbinTestCase(unittest.TestCase) data = json.loads(response.data.decode('utf-8')) self.assertEqual(data['args'], {}) self.assertEqual(data['headers']['Host'], 'localhost') @@ -32,3 +32,45 @@ index b7104ffc..ea51ae81 100755 self.assertEqual(data['url'], 'http://localhost/anything/foo/bar') self.assertEqual(data['method'], 'GET') self.assertTrue(response.data.endswith(b'\n')) +@@ -586,7 +584,7 @@ class HttpbinTestCase(unittest.TestCase) + def test_redirect_n_higher_than_1(self): + response = self.app.get('/redirect/5') + self.assertEqual( +- response.headers.get('Location'), '/relative-redirect/4' ++ response.headers.get('Location'), 'http://localhost/relative-redirect/4' + ) + + def test_redirect_to_post(self): +@@ -595,7 +593,7 @@ class HttpbinTestCase(unittest.TestCase) + content_type='application/octet-stream') + self.assertEqual(response.status_code, 307) + self.assertEqual( +- response.headers.get('Location'), '/post' ++ response.headers.get('Location'), 'http://localhost/post' + ) + + def test_redirect_absolute_param_n_higher_than_1(self): +@@ -608,20 +606,20 @@ class HttpbinTestCase(unittest.TestCase) + response = self.app.get('/redirect/1') + self.assertEqual(response.status_code, 302) + self.assertEqual( +- response.headers.get('Location'), '/get' ++ response.headers.get('Location'), 'http://localhost/get' + ) + + def test_relative_redirect_n_equals_to_1(self): + response = self.app.get('/relative-redirect/1') + self.assertEqual( +- response.headers.get('Location'), '/get' ++ response.headers.get('Location'), 'http://localhost/get' + ) + + def test_relative_redirect_n_higher_than_1(self): + response = self.app.get('/relative-redirect/7') + self.assertEqual(response.status_code, 302) + self.assertEqual( +- response.headers.get('Location'), '/relative-redirect/6' ++ response.headers.get('Location'), 'http://localhost/relative-redirect/6' + ) + + def test_absolute_redirect_n_higher_than_1(self):