Commit 77553ab5 authored by Jeremy Hylton's avatar Jeremy Hylton

Fix test for new version of urllib that uses HTTPConnection directly.

Changes the way the httplib classes are stubbed out.
parent 39b198d8
......@@ -111,11 +111,11 @@ class urlopen_HttpTests(unittest.TestCase):
class FakeHTTPConnection(httplib.HTTPConnection):
def connect(self):
self.sock = FakeSocket(fakedata)
assert httplib.HTTP._connection_class == httplib.HTTPConnection
httplib.HTTP._connection_class = FakeHTTPConnection
self._connection_class = httplib.HTTPConnection
httplib.HTTPConnection = FakeHTTPConnection
def unfakehttp(self):
httplib.HTTP._connection_class = httplib.HTTPConnection
httplib.HTTPConnection = self._connection_class
def test_read(self):
self.fakehttp(b"Hello!")
......
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