[wwwsearch-commits] r22695 - wwwsearch/mechanize/trunk

jjlee at codespeak.net jjlee at codespeak.net
Thu Jan 26 21:48:30 CET 2006


Author: jjlee
Date: Thu Jan 26 21:48:29 2006
New Revision: 22695

Modified:
   wwwsearch/mechanize/trunk/test.py
Log:
Fix instances of URLError that should be HTTPError

Modified: wwwsearch/mechanize/trunk/test.py
==============================================================================
--- wwwsearch/mechanize/trunk/test.py	(original)
+++ wwwsearch/mechanize/trunk/test.py	Thu Jan 26 21:48:29 2006
@@ -94,7 +94,7 @@
     def handle(self, fn_name, response, *args, **kwds):
         self.parent.calls.append((self, fn_name, args, kwds))
         if response:
-            if isinstance(response, urllib2.URLError):
+            if isinstance(response, urllib2.HTTPError):
                 raise response
             r = response
             r.seek(0)
@@ -235,7 +235,7 @@
         self.assertRaises(mechanize.BrowserStateError, b.back, 2)
         r8 = b.open("/spam")
 
-        # even if we get a URLError, history and .response() should still get updated
+        # even if we get a HTTPError, history and .response() should still get updated
         error = urllib2.HTTPError("http://example.com/bad", 503, "Oops",
                                   MockHeaders(), StringIO.StringIO())
         b.add_handler(MockHandler([("https_open", error)]))


More information about the wwwsearch-commits mailing list