summaryrefslogtreecommitdiffhomepage
path: root/test/test_python_application.py
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-09-21 21:18:13 +0300
committerMax Romanov <max.romanov@nginx.com>2020-09-21 21:18:13 +0300
commit449652afa16160aaf2e36c81b64b0220e6ba96b1 (patch)
tree436faae6dc78bfa667ccf7792d7d0f23dcc5a652 /test/test_python_application.py
parentaf964488bad7fe00855749520d929ea1cb0de9d4 (diff)
downloadunit-449652afa16160aaf2e36c81b64b0220e6ba96b1.tar.gz
unit-449652afa16160aaf2e36c81b64b0220e6ba96b1.tar.bz2
Tests: added multiple headers concatenation test.
Diffstat (limited to 'test/test_python_application.py')
-rw-r--r--test/test_python_application.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/test/test_python_application.py b/test/test_python_application.py
index e6ad6a01..434ceb19 100644
--- a/test/test_python_application.py
+++ b/test/test_python_application.py
@@ -20,14 +20,18 @@ class TestPythonApplication(TestApplicationPython):
body = 'Test body string.'
- resp = self.post(
- headers={
- 'Host': 'localhost',
- 'Content-Type': 'text/html',
- 'Custom-Header': 'blah',
- 'Connection': 'close',
- },
- body=body,
+ resp = self.http(
+ b"""POST / HTTP/1.1
+Host: localhost
+Content-Length: %d
+Custom-Header: blah
+Custom-hEader: Blah
+Content-Type: text/html
+Connection: close
+custom-header: BLAH
+
+%s""" % (len(body), body.encode()),
+ raw=True,
)
assert resp['status'] == 200, 'status'
@@ -52,7 +56,7 @@ class TestPythonApplication(TestApplicationPython):
'Request-Uri': '/',
'Http-Host': 'localhost',
'Server-Protocol': 'HTTP/1.1',
- 'Custom-Header': 'blah',
+ 'Custom-Header': 'blah, Blah, BLAH',
'Wsgi-Version': '(1, 0)',
'Wsgi-Url-Scheme': 'http',
'Wsgi-Multithread': 'False',