Author: jeremy.hylton
Date: Sat Aug 4 21:23:09 2007
New Revision: 56743
Modified:
python/branches/py3k-struni/Lib/test/test_urllib.py
Log:
Fix test for new version of urllib that uses HTTPConnection directly.
Changes the way the httplib classes are stubbed out.
Modified: python/branches/py3k-struni/Lib/test/test_urllib.py
==============================================================================
--- python/branches/py3k-struni/Lib/test/test_urllib.py (original)
+++ python/branches/py3k-struni/Lib/test/test_urllib.py Sat Aug 4 21:23:09 2007
@@ -111,11 +111,11 @@
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!")
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins