Changeset 70103 in webkit
- Timestamp:
- Oct 19, 2010 4:02:49 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r70096 r70103 1 2010-10-19 Eric Seidel <eric@webkit.org> 2 3 Unreviewed, just fixing test-webkitpy. I'm really on a roll today. 4 5 commit-queue gets stuck when release-patch returns 404 6 https://bugs.webkit.org/show_bug.cgi?id=47935 7 8 Fix test-webkitpy and unittest NetworkTransaction. 9 10 * Scripts/webkitpy/common/net/networktransaction.py: 11 * Scripts/webkitpy/common/net/networktransaction_unittest.py: 12 1 13 2010-10-19 Eric Seidel <eric@webkit.org> 2 14 -
trunk/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py
r70092 r70103 46 46 self._grown_factor = grown_factor 47 47 self._timeout_seconds = timeout_seconds 48 self._convert_404_to_None = convert_404_to_None 48 49 49 50 def run(self, request): … … 55 56 # FIXME: We should catch urllib2.HTTPError here too. 56 57 except mechanize.HTTPError, e: 57 if convert_404_to_None and e.code == 404:58 if self._convert_404_to_None and e.code == 404: 58 59 return None 59 60 self._check_for_timeout() -
trunk/WebKitTools/Scripts/webkitpy/common/net/networktransaction_unittest.py
r56988 r70103 57 57 self.assertTrue(did_process_exception) 58 58 59 def _raise_ http_error(self):59 def _raise_500_error(self): 60 60 self._run_count += 1 61 61 if self._run_count < 3: 62 raise HTTPError("http://example.com/", 500, "inte neral server error", None, None)62 raise HTTPError("http://example.com/", 500, "internal server error", None, None) 63 63 return 42 64 65 def _raise_404_error(self): 66 raise HTTPError("http://foo.com/", 404, "not found", None, None) 64 67 65 68 def test_retry(self): 66 69 self._run_count = 0 67 70 transaction = NetworkTransaction(initial_backoff_seconds=0) 68 self.assertEqual(transaction.run(lambda: self._raise_ http_error()), 42)71 self.assertEqual(transaction.run(lambda: self._raise_500_error()), 42) 69 72 self.assertEqual(self._run_count, 3) 70 73 self.assertLog(['WARNING: Received HTTP status 500 from server. ' … … 72 75 'WARNING: Received HTTP status 500 from server. ' 73 76 'Retrying in 0.0 seconds...\n']) 77 78 def test_convert_404_to_None(self): 79 transaction = NetworkTransaction(convert_404_to_None=True) 80 self.assertEqual(transaction.run(lambda: self._raise_404_error()), None) 74 81 75 82 def test_timeout(self): … … 79 86 did_throw_exception = True 80 87 try: 81 transaction.run(lambda: self._raise_ http_error())88 transaction.run(lambda: self._raise_500_error()) 82 89 did_throw_exception = False 83 90 except NetworkTimeout, e:
Note: See TracChangeset
for help on using the changeset viewer.