本文整理汇总了Python中webkitpy.tool.mocktool.MockTool.user方法的典型用法代码示例。如果您正苦于以下问题:Python MockTool.user方法的具体用法?Python MockTool.user怎么用?Python MockTool.user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webkitpy.tool.mocktool.MockTool
的用法示例。
在下文中一共展示了MockTool.user方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _test_check_test_expectations
# 需要导入模块: from webkitpy.tool.mocktool import MockTool [as 别名]
# 或者: from webkitpy.tool.mocktool.MockTool import user [as 别名]
def _test_check_test_expectations(self, filename):
capture = OutputCapture()
options = MockOptions()
options.git_commit = ""
options.non_interactive = True
tool = MockTool()
tool.user = None # Will cause any access of tool.user to raise an exception.
step = Commit(tool, options)
state = {
"changed_files": [filename + "XXX"],
}
tool.executive = MockExecutive(should_log=True, should_throw_when_run=False)
expected_logs = "Committed r49824: <http://trac.webkit.org/changeset/49824>\n"
capture.assert_outputs(self, step.run, [state], expected_logs=expected_logs)
state = {
"changed_files": ["platform/chromium/" + filename],
}
expected_logs = """MOCK run_and_throw_if_fail: ['mock-check-webkit-style', '--diff-files', 'platform/chromium/%s'], cwd=/mock-checkout
Committed r49824: <http://trac.webkit.org/changeset/49824>
""" % filename
capture.assert_outputs(self, step.run, [state], expected_logs=expected_logs)
tool.executive = MockExecutive(should_log=True, should_throw_when_run=set(["platform/chromium/" + filename]))
self.assertRaises(ScriptError, capture.assert_outputs, self, step.run, [state])