Commit 022c4746 authored by Guido van Rossum's avatar Guido van Rossum

Make test_httplib pass.

parent 70d0ddab
...@@ -53,7 +53,7 @@ class HeaderTests(TestCase): ...@@ -53,7 +53,7 @@ class HeaderTests(TestCase):
def __init__(self): def __init__(self):
self.count = {} self.count = {}
def append(self, item): def append(self, item):
kv = item.split(':') kv = item.split(b':')
if len(kv) > 1: if len(kv) > 1:
# item is a 'Key: Value' header string # item is a 'Key: Value' header string
lcKey = kv[0].decode('ascii').lower() lcKey = kv[0].decode('ascii').lower()
...@@ -138,8 +138,8 @@ class BasicTest(TestCase): ...@@ -138,8 +138,8 @@ class BasicTest(TestCase):
resp.close() resp.close()
def test_send_file(self): def test_send_file(self):
expected = ('GET /foo HTTP/1.1\r\nHost: example.com\r\n' expected = (b'GET /foo HTTP/1.1\r\nHost: example.com\r\n'
'Accept-Encoding: identity\r\nContent-Length:') b'Accept-Encoding: identity\r\nContent-Length:')
body = open(__file__, 'rb') body = open(__file__, 'rb')
conn = httplib.HTTPConnection('example.com') conn = httplib.HTTPConnection('example.com')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment