commit:     5bfd17750b65ff200b0d963c0dee50cb2618b942
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 15 10:35:44 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Feb 15 10:35:44 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5bfd1775

dev-python/httpbin: Update no-flasgger patch for better compat

Update the no-flasgger patch not to create a redirect, as that causes
test failures in dev-python/httpcore.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../files/httpbin-0.10.1-optional-flasgger.patch   | 24 +---------------------
 ...n-0.10.1-r4.ebuild => httpbin-0.10.1-r5.ebuild} |  0
 2 files changed, 1 insertion(+), 23 deletions(-)

diff --git a/dev-python/httpbin/files/httpbin-0.10.1-optional-flasgger.patch 
b/dev-python/httpbin/files/httpbin-0.10.1-optional-flasgger.patch
index c3d87ec4144d..d4695173dad5 100644
--- a/dev-python/httpbin/files/httpbin-0.10.1-optional-flasgger.patch
+++ b/dev-python/httpbin/files/httpbin-0.10.1-optional-flasgger.patch
@@ -54,34 +54,12 @@ index a82c1b8..77576a4 100644
 +    @app.route("/")
 +    def no_flasgger_index():
 +        """Redirect to legacy index if flasgger is not available."""
-+        return redirect(url_for("view_landing_page"))
++        return view_landing_page()
 +
 +
  @app.route("/legacy")
  def view_landing_page():
      """Generates Landing Page in legacy layout."""
-diff --git a/tests/test_httpbin.py b/tests/test_httpbin.py
-index 6b75124..2ce63a6 100755
---- a/tests/test_httpbin.py
-+++ b/tests/test_httpbin.py
-@@ -10,6 +10,7 @@ from hashlib import md5, sha256, sha512
- from io import BytesIO
- 
- import httpbin
-+from httpbin.core import Swagger
- from httpbin.helpers import parse_multi_value_header
- 
- 
-@@ -115,7 +116,8 @@ class HttpbinTestCase(unittest.TestCase):
- 
-     def test_index(self):   
-         response = self.app.get('/', headers={'User-Agent': 'test'})
--        self.assertEqual(response.status_code, 200)
-+        self.assertEqual(response.status_code,
-+                         200 if Swagger is not None else 302)
-  
-     def get_data(self, response):
-         if 'get_data' in dir(response):
 -- 
 2.43.0
 

diff --git a/dev-python/httpbin/httpbin-0.10.1-r4.ebuild 
b/dev-python/httpbin/httpbin-0.10.1-r5.ebuild
similarity index 100%
rename from dev-python/httpbin/httpbin-0.10.1-r4.ebuild
rename to dev-python/httpbin/httpbin-0.10.1-r5.ebuild

Reply via email to