mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Merged revisions 85205 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85205 | senthil.kumaran | 2010-10-03 23:52:42 +0530 (Sun, 03 Oct 2010) | 3 lines Fix Issue10012 - httplib headers, which are (sometimes mistakenly) int are explicitly cast to str (bytes - in py3k). ........
This commit is contained in:
parent
5e8826cd98
commit
97304567a7
2 changed files with 11 additions and 0 deletions
|
@ -89,6 +89,15 @@ class HeaderTests(TestCase):
|
|||
conn.request('POST', '/', body, headers)
|
||||
self.assertEqual(conn._buffer.count[header.lower()], 1)
|
||||
|
||||
def test_putheader(self):
|
||||
conn = client.HTTPConnection('example.com')
|
||||
conn.sock = FakeSocket(None)
|
||||
conn.putrequest('GET','/')
|
||||
conn.putheader('Content-length', 42)
|
||||
print(conn._buffer)
|
||||
self.assertTrue(b'Content-length: 42' in conn._buffer)
|
||||
|
||||
|
||||
class BasicTest(TestCase):
|
||||
def test_status_lines(self):
|
||||
# Test HTTP status lines
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue