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