diff options
| author | Senthil Kumaran <orsenthil@gmail.com> | 2010-10-03 18:26:07 (GMT) |
|---|---|---|
| committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-10-03 18:26:07 (GMT) |
| commit | aa5f49e4c132c217ffacb85261443408c3a524df (patch) | |
| tree | 105771758c16f8d9061b9c26fac30babb6530b94 /Lib/test/test_httplib.py | |
| parent | a9bd0cc67e77d465ae747071377407f00d62f19c (diff) | |
| download | cpython-aa5f49e4c132c217ffacb85261443408c3a524df.zip cpython-aa5f49e4c132c217ffacb85261443408c3a524df.tar.gz cpython-aa5f49e4c132c217ffacb85261443408c3a524df.tar.bz2 | |
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).
........
Diffstat (limited to 'Lib/test/test_httplib.py')
| -rw-r--r-- | Lib/test/test_httplib.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index 435a9fc..74301ff 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -1,3 +1,4 @@ +import httplib import array import httplib import StringIO @@ -64,8 +65,6 @@ class HeaderTests(TestCase): # Some headers are added automatically, but should not be added by # .request() if they are explicitly set. - import httplib - class HeaderCountingBuffer(list): def __init__(self): self.count = {} @@ -91,6 +90,13 @@ class HeaderTests(TestCase): conn.request('POST', '/', body, headers) self.assertEqual(conn._buffer.count[header.lower()], 1) + def test_putheader(self): + conn = httplib.HTTPConnection('example.com') + conn.sock = FakeSocket(None) + conn.putrequest('GET','/') + conn.putheader('Content-length',42) + self.assertTrue('Content-length: 42' in conn._buffer) + class BasicTest(TestCase): def test_status_lines(self): # Test HTTP status lines |
