test_http_header.py (936:512cf564dfa8) test_http_header.py (942:424c1fdef545)
1import unittest
2import unit
3
4class TestUnitHTTPHeader(unit.TestUnitApplicationPython):
5
6 def setUpClass():
7 unit.TestUnit().check_modules('python')
8

--- 184 unchanged lines hidden (view full) ---

193 self.load('empty')
194
195 self.assertEqual(self.post(headers={
196 'Content-Length': '41, 42',
197 'Connection': 'close',
198 'Host': 'localhost'
199 }, body='X' * 1000)['status'], 400, 'Content-Length multiple value')
200
1import unittest
2import unit
3
4class TestUnitHTTPHeader(unit.TestUnitApplicationPython):
5
6 def setUpClass():
7 unit.TestUnit().check_modules('python')
8

--- 184 unchanged lines hidden (view full) ---

193 self.load('empty')
194
195 self.assertEqual(self.post(headers={
196 'Content-Length': '41, 42',
197 'Connection': 'close',
198 'Host': 'localhost'
199 }, body='X' * 1000)['status'], 400, 'Content-Length multiple value')
200
201 @unittest.expectedFailure
202 def test_http_header_content_length_multiple_fields(self):
203 self.load('empty')
204
205 self.assertEqual(self.post(headers={
206 'Content-Length': ['41', '42'],
207 'Connection': 'close',
208 'Host': 'localhost'
209 }, body='X' * 1000)['status'], 400, 'Content-Length multiple fields')
210
211if __name__ == '__main__':
212 TestUnitHTTPHeader.main()
201 def test_http_header_content_length_multiple_fields(self):
202 self.load('empty')
203
204 self.assertEqual(self.post(headers={
205 'Content-Length': ['41', '42'],
206 'Connection': 'close',
207 'Host': 'localhost'
208 }, body='X' * 1000)['status'], 400, 'Content-Length multiple fields')
209
210if __name__ == '__main__':
211 TestUnitHTTPHeader.main()