summaryrefslogtreecommitdiffhomepage
path: root/test/test_python_application.py
diff options
context:
space:
mode:
authorTiago Natel <t.nateldemoura@f5.com>2019-11-26 15:58:25 +0000
committerTiago Natel <t.nateldemoura@f5.com>2019-11-26 15:58:25 +0000
commit01103c50055abef3640cef57d820567931bb3518 (patch)
tree149709cb399400242d1b12635a5c86828d3173df /test/test_python_application.py
parent4eecf1cb6ad520458e595313dc65e3e75405a252 (diff)
downloadunit-01103c50055abef3640cef57d820567931bb3518.tar.gz
unit-01103c50055abef3640cef57d820567931bb3518.tar.bz2
Tests: parsing of "Transfer-Encoding: chunked" responses.
Diffstat (limited to 'test/test_python_application.py')
-rw-r--r--test/test_python_application.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/test/test_python_application.py b/test/test_python_application.py
index ae8f01ca..5e1ba65a 100644
--- a/test/test_python_application.py
+++ b/test/test_python_application.py
@@ -540,7 +540,7 @@ Connection: close
}
)
self.assertEqual(resp['status'], 200, 'status')
- self.assertEqual(resp['body'][-5:], '0\r\n\r\n', 'body')
+ self.assertEqual(resp['body'], 'XXXXXXX', 'body')
# Exception before start_response().
@@ -607,12 +607,11 @@ Connection: close
'X-Skip': '2',
'X-Chunked': '1',
'Connection': 'close',
- }
+ },
+ raw_resp=True
)
- if 'body' in resp:
- self.assertNotEqual(
- resp['body'][-5:], '0\r\n\r\n', 'incomplete body'
- )
+ if resp:
+ self.assertNotEqual(resp[-5:], '0\r\n\r\n', 'incomplete body')
self.assertEqual(
len(self.findall(r'Traceback')), 4, 'traceback count 4'
)
@@ -646,12 +645,11 @@ Connection: close
'X-Skip': '3',
'X-Chunked': '1',
'Connection': 'close',
- }
+ },
+ raw_resp=True
)
- if 'body' in resp:
- self.assertNotEqual(
- resp['body'][-5:], '0\r\n\r\n', 'incomplete body 2'
- )
+ if resp:
+ self.assertNotEqual(resp[-5:], '0\r\n\r\n', 'incomplete body 2')
self.assertEqual(
len(self.findall(r'Traceback')), 6, 'traceback count 6'
)