Changeset 85462 in webkit
- Timestamp:
- May 2, 2011 12:17:32 AM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r85461 r85462 1 2011-05-02 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 workspace.py fails to import ScriptError 6 https://bugs.webkit.org/show_bug.cgi?id=59915 7 8 If the workspace fails to create a zip, webkitpy crashes instead of 9 handling the error as expected. 10 11 * Scripts/webkitpy/common/system/workspace.py: 12 * Scripts/webkitpy/common/system/workspace_unittest.py: 13 * Scripts/webkitpy/tool/mocktool.py: 14 1 15 2011-05-01 Adam Barth <abarth@webkit.org> 2 16 -
trunk/Tools/Scripts/webkitpy/common/system/workspace.py
r84333 r85462 32 32 import logging 33 33 import zipfile 34 35 from webkitpy.common.system.executive import ScriptError 34 36 35 37 -
trunk/Tools/Scripts/webkitpy/common/system/workspace_unittest.py
r76071 r85462 57 57 archive = OutputCapture().assert_outputs(self, workspace.create_zip, ["/zip/path", "/source/path", MockZipFile], expected_stderr=expected_stderr) 58 58 self.assertEqual(archive.filename, "/zip/path") 59 60 def test_create_zip_exception(self): 61 workspace = Workspace(None, MockExecutive(should_log=True, should_throw=True)) 62 expected_stderr = "MOCK run_command: ['zip', '-r', '/zip/path', '/source/path']\n" 63 class MockZipFile(object): 64 def __init__(self, path): 65 self.filename = path 66 archive = OutputCapture().assert_outputs(self, workspace.create_zip, ["/zip/path", "/source/path", MockZipFile], expected_stderr=expected_stderr) 67 self.assertEqual(archive, None) -
trunk/Tools/Scripts/webkitpy/tool/mocktool.py
r85065 r85462 35 35 from webkitpy.common.net.bugzilla import Bug, Attachment 36 36 from webkitpy.common.system.deprecated_logging import log 37 from webkitpy.common.system.executive import ScriptError 37 38 from webkitpy.common.system.filesystem_mock import MockFileSystem 38 39 from webkitpy.thirdparty.mock import Mock … … 663 664 # FIXME: Unify with common.system.executive_mock.MockExecutive. 664 665 class MockExecutive(Mock): 665 def __init__(self, should_log): 666 self.should_log = should_log 666 def __init__(self, should_log, should_throw=False): 667 self._should_log = should_log 668 self._should_throw = should_throw 667 669 668 670 def run_and_throw_if_fail(self, args, quiet=False): 669 if self. should_log:671 if self._should_log: 670 672 log("MOCK run_and_throw_if_fail: %s" % args) 671 673 return "MOCK output of child process" … … 679 681 return_stderr=True, 680 682 decode_output=False): 681 if self. should_log:683 if self._should_log: 682 684 log("MOCK run_command: %s" % args) 685 if self._should_throw: 686 raise ScriptError("MOCK ScriptError") 683 687 return "MOCK output of child process" 684 688
Note: See TracChangeset
for help on using the changeset viewer.