From: Jeremy Hylton Date: Sat, 4 Aug 2007 19:23:09 +0000 (+0000) Subject: Fix test for new version of urllib that uses HTTPConnection directly. X-Git-Tag: v3.0a1~523 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=77553ab531c6a98c3d06b7ba4158b06ed0af8c69;p=python Fix test for new version of urllib that uses HTTPConnection directly. Changes the way the httplib classes are stubbed out. --- diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index a31bb52e31..dde5d581d8 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -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!")