[wwwsearch-commits] r36532 - wwwsearch/mechanize/trunk
jjlee at codespeak.net
jjlee at codespeak.net
Thu Jan 11 22:20:11 CET 2007
Author: jjlee
Date: Thu Jan 11 22:20:08 2007
New Revision: 36532
Modified:
wwwsearch/mechanize/trunk/functional_tests.py
Log:
Add a functional test for 302 + 404
Modified: wwwsearch/mechanize/trunk/functional_tests.py
==============================================================================
--- wwwsearch/mechanize/trunk/functional_tests.py (original)
+++ wwwsearch/mechanize/trunk/functional_tests.py Thu Jan 11 22:20:08 2007
@@ -45,6 +45,16 @@
self.browser.open('/mechanize/')
self.assertEqual(self.browser.title(), 'mechanize')
+ def test_302_and_404(self):
+ # the combination of 302 (caused by use of "sf.net") and 404 has caused
+ # problems in the past due to accidental double-wrapping of the error
+ # response
+ import urllib2
+ self.assertRaises(
+ urllib2.HTTPError,
+ self.browser.open, "http://wwwsearch.sf.net/doesnotexist"
+ )
+
def test_reread(self):
r = self.browser.open('http://wwwsearch.sourceforge.net/')
data = r.read()
More information about the wwwsearch-commits
mailing list