diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
| commit | ad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (patch) | |
| tree | b34b0daceb7c8e7fdde4b4ec43650ab7caadb0a9 /Tools/Scripts/webkitpy/common/system/executive_mock.py | |
| parent | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (diff) | |
| download | qtwebkit-ad0d549d4cc13433f77c1ac8f0ab379c83d93f28.tar.gz | |
Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 (http://svn.webkit.org/repository/webkit/trunk@108790)
Diffstat (limited to 'Tools/Scripts/webkitpy/common/system/executive_mock.py')
| -rw-r--r-- | Tools/Scripts/webkitpy/common/system/executive_mock.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Tools/Scripts/webkitpy/common/system/executive_mock.py b/Tools/Scripts/webkitpy/common/system/executive_mock.py index f698235e9..a76268129 100644 --- a/Tools/Scripts/webkitpy/common/system/executive_mock.py +++ b/Tools/Scripts/webkitpy/common/system/executive_mock.py @@ -32,8 +32,16 @@ from webkitpy.common.system.deprecated_logging import log from webkitpy.common.system.executive import ScriptError +class MockProcess(object): + def __init__(self): + self.pid = 42 + + # FIXME: This should be unified with MockExecutive2 class MockExecutive(object): + PIPE = "MOCK PIPE" + STDOUT = "MOCK STDOUT" + @staticmethod def ignore_error(error): pass @@ -55,7 +63,7 @@ class MockExecutive(object): env_string = ", env=%s" % env log("MOCK run_and_throw_if_fail: %s, cwd=%s%s" % (args, cwd, env_string)) if self._should_throw_when_run.intersection(args): - raise ScriptError("Exception for %s" % args) + raise ScriptError("Exception for %s" % args, output="MOCK command output") return "MOCK output of child process" def run_command(self, @@ -81,6 +89,10 @@ class MockExecutive(object): def cpu_count(self): return 2 + def popen(self, *args, **kwargs): + # FIXME: Implement logging when self._should_log is set. + return MockProcess() + class MockExecutive2(object): @staticmethod |
