diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-10-03 18:22:42 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-10-03 18:22:42 (GMT) |
commit | 58d5dbf80b8506e9f861c966125b023e591b682f (patch) | |
tree | 6b08634d70d2c2ee2099a6e1500b9cb0cf48bca1 /Lib/test/test_httplib.py | |
parent | 4271372a7145fe4a8e44982e5b89c3c7e3637c8e (diff) | |
download | cpython-58d5dbf80b8506e9f861c966125b023e591b682f.zip cpython-58d5dbf80b8506e9f861c966125b023e591b682f.tar.gz cpython-58d5dbf80b8506e9f861c966125b023e591b682f.tar.bz2 |
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 | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index e9d24ba..5a6422d 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -90,6 +90,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 |