15
0
Files
python-httpbin/werkzeug.patch

77 lines
3.4 KiB
Diff

From b6cb2b47a3813da5df8dbffada284b72d7fe099e Mon Sep 17 00:00:00 2001
From: Simon Kowallik <github@simonkowallik.com>
Date: Sat, 18 May 2019 13:10:08 +0200
Subject: [PATCH] fix #554: update tests, Pipfile, Pipfile.lock for
werkzeug>=0.15.1
- update test_httpbin.py to reflect new behaviour of werkzeug
- require werkzeug>=0.15.1
---
Pipfile | 2 +-
Pipfile.lock | 6 +++---
test_httpbin.py | 2 --
3 files changed, 4 insertions(+), 6 deletions(-)
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')
- self.assertEqual(data['headers']['Content-Length'], '0')
self.assertEqual(data['headers']['User-Agent'], 'test')
# self.assertEqual(data['origin'], None)
self.assertEqual(data['url'], 'http://localhost/get')
@@ -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')
- self.assertEqual(data['headers']['Content-Length'], '0')
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):