mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
merge with 3.3
This commit is contained in:
commit
b89b5df9c9
13 changed files with 191 additions and 38 deletions
|
@ -347,6 +347,15 @@ class BasicTest(TestCase):
|
|||
self.fail("Did not expect response from HEAD request")
|
||||
self.assertEqual(bytes(b), b'\x00'*5)
|
||||
|
||||
def test_too_many_headers(self):
|
||||
headers = '\r\n'.join('Header%d: foo' % i
|
||||
for i in range(client._MAXHEADERS + 1)) + '\r\n'
|
||||
text = ('HTTP/1.1 200 OK\r\n' + headers)
|
||||
s = FakeSocket(text)
|
||||
r = client.HTTPResponse(s)
|
||||
self.assertRaisesRegex(client.HTTPException,
|
||||
r"got more than \d+ headers", r.begin)
|
||||
|
||||
def test_send_file(self):
|
||||
expected = (b'GET /foo HTTP/1.1\r\nHost: example.com\r\n'
|
||||
b'Accept-Encoding: identity\r\nContent-Length:')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue