当前位置: 首页>>代码示例>>Python>>正文


Python MockOptions.git_commit方法代码示例

本文整理汇总了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])
开发者ID:,项目名称:,代码行数:29,代码来源:

示例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, [{}])
开发者ID:0x4d52,项目名称:JavaScriptCore-X,代码行数:9,代码来源:updatechangelogswithreview_unittest.py

示例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])
开发者ID:,项目名称:,代码行数:28,代码来源:


注:本文中的webkitpy.tool.mocktool.MockOptions.git_commit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。