Line 0
Link Here
|
|
|
1 |
--- test_httpbin.py.orig 2018-05-08 11:41:03 UTC |
2 |
+++ test_httpbin.py |
3 |
@@ -144,7 +144,9 @@ class HttpbinTestCase(unittest.TestCase): |
4 |
data = json.loads(response.data.decode('utf-8')) |
5 |
self.assertEqual(data['args'], {}) |
6 |
self.assertEqual(data['headers']['Host'], 'localhost') |
7 |
- self.assertEqual(data['headers']['Content-Length'], '0') |
8 |
+ # Newest Werkzeug versions omit Content-Length if '0'; see |
9 |
+ # https://github.com/postmanlabs/httpbin/pull/555/files |
10 |
+ self.assertEqual(data['headers'].get('Content-Length', '0'), '0') |
11 |
self.assertEqual(data['headers']['User-Agent'], 'test') |
12 |
# self.assertEqual(data['origin'], None) |
13 |
self.assertEqual(data['url'], 'http://localhost/get') |
14 |
@@ -158,7 +160,9 @@ class HttpbinTestCase(unittest.TestCase): |
15 |
data = json.loads(response.data.decode('utf-8')) |
16 |
self.assertEqual(data['args'], {}) |
17 |
self.assertEqual(data['headers']['Host'], 'localhost') |
18 |
- self.assertEqual(data['headers']['Content-Length'], '0') |
19 |
+ # Newest Werkzeug versions omit Content-Length if '0'; see |
20 |
+ # https://github.com/postmanlabs/httpbin/pull/555/files |
21 |
+ self.assertEqual(data['headers'].get('Content-Length', '0'), '0') |
22 |
self.assertEqual(data['url'], 'http://localhost/anything/foo/bar') |
23 |
self.assertEqual(data['method'], 'GET') |
24 |
self.assertTrue(response.data.endswith(b'\n')) |