summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2007-08-04 19:23:09 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2007-08-04 19:23:09 (GMT)
commit77553ab531c6a98c3d06b7ba4158b06ed0af8c69 (patch)
tree5fcb0fffaeca373a8f5c539bfd9279121cca2001
parent39b198d8354b2b1b059488acbd3804b6a01641a8 (diff)
downloadcpython-77553ab531c6a98c3d06b7ba4158b06ed0af8c69.zip
cpython-77553ab531c6a98c3d06b7ba4158b06ed0af8c69.tar.gz
cpython-77553ab531c6a98c3d06b7ba4158b06ed0af8c69.tar.bz2
Fix test for new version of urllib that uses HTTPConnection directly.
Changes the way the httplib classes are stubbed out.
-rw-r--r--Lib/test/test_urllib.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index a31bb52..dde5d58 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!")