Deleted
Added
test_settings.py (760:18943cf07343) | test_settings.py (767:31390ed4c36d) |
---|---|
1import time 2import socket 3import unittest 4import unit 5 6class TestUnitSettings(unit.TestUnitApplicationPython): 7 8 def setUpClass(): --- 11 unchanged lines hidden (view full) --- 20 21 resp = self.http(b"""Host: localhost 22Connection: close 23 24""", sock=sock, raw=True) 25 26 self.assertEqual(resp['status'], 408, 'status header read timeout') 27 | 1import time 2import socket 3import unittest 4import unit 5 6class TestUnitSettings(unit.TestUnitApplicationPython): 7 8 def setUpClass(): --- 11 unchanged lines hidden (view full) --- 20 21 resp = self.http(b"""Host: localhost 22Connection: close 23 24""", sock=sock, raw=True) 25 26 self.assertEqual(resp['status'], 408, 'status header read timeout') 27 |
28 @unittest.expectedFailure | |
29 def test_settings_header_read_timeout_update(self): 30 self.load('empty') 31 | 28 def test_settings_header_read_timeout_update(self): 29 self.load('empty') 30 |
31 r = None 32 |
|
32 self.conf({'http': { 'header_read_timeout': 4 }}, 'settings') 33 34 (resp, sock) = self.http(b"""GET / HTTP/1.1 35""", start=True, raw=True, no_recv=True) 36 37 time.sleep(2) 38 39 (resp, sock) = self.http(b"""Host: localhost 40""", start=True, sock=sock, raw=True, no_recv=True) 41 42 time.sleep(2) 43 44 (resp, sock) = self.http(b"""X-Blah: blah | 33 self.conf({'http': { 'header_read_timeout': 4 }}, 'settings') 34 35 (resp, sock) = self.http(b"""GET / HTTP/1.1 36""", start=True, raw=True, no_recv=True) 37 38 time.sleep(2) 39 40 (resp, sock) = self.http(b"""Host: localhost 41""", start=True, sock=sock, raw=True, no_recv=True) 42 43 time.sleep(2) 44 45 (resp, sock) = self.http(b"""X-Blah: blah |
45""", start=True, sock=sock, raw=True, no_recv=True) | 46""", start=True, sock=sock, raw=True) |
46 | 47 |
47 time.sleep(2) | 48 if len(resp) != 0: 49 sock.close() |
48 | 50 |
49 resp = self.http(b"""Connection: close | 51 else: 52 time.sleep(2) |
50 | 53 |
54 resp = self.http(b"""Connection: close 55 |
|
51""", sock=sock, raw=True) 52 53 self.assertEqual(resp['status'], 408, 54 'status header read timeout update') 55 56 def test_settings_body_read_timeout(self): 57 self.load('empty') 58 --- 110 unchanged lines hidden --- | 56""", sock=sock, raw=True) 57 58 self.assertEqual(resp['status'], 408, 59 'status header read timeout update') 60 61 def test_settings_body_read_timeout(self): 62 self.load('empty') 63 --- 110 unchanged lines hidden --- |