Index: tools/push-to-trunk/test_scripts.py |
diff --git a/tools/push-to-trunk/test_scripts.py b/tools/push-to-trunk/test_scripts.py |
index f4d0c126ce0fb052221e0618fba4decead97d693..acb28a097c70ec6f485521c979e5256feb64102e 100644 |
--- a/tools/push-to-trunk/test_scripts.py |
+++ b/tools/push-to-trunk/test_scripts.py |
@@ -216,7 +216,12 @@ class SimpleMock(object): |
# callback for checking the context at the time of the call. |
if len(expected_call) == len(args) + 2: |
expected_call[len(args) + 1]() |
- return expected_call[len(args)] |
+ return_value = expected_call[len(args)] |
+ |
+ # If the return value is an exception, raise it instead of returning. |
+ if isinstance(return_value, Exception): |
+ raise return_value |
+ return return_value |
def AssertFinished(self): |
if self._index < len(self._recipe) -1: |
@@ -269,6 +274,9 @@ class ScriptTest(unittest.TestCase): |
def ReadURL(self, url): |
return self._url_mock.Call(url) |
+ def Sleep(self, seconds): |
+ pass |
+ |
def ExpectGit(self, *args): |
"""Convenience wrapper.""" |
self._git_mock.Expect(*args) |
@@ -674,6 +682,7 @@ class ScriptTest(unittest.TestCase): |
os.environ["EDITOR"] = "vi" |
self.ExpectReadURL([ |
+ ["https://v8-status.appspot.com/lkgr", Exception("Network problem")], |
["https://v8-status.appspot.com/lkgr", "100"], |
]) |