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


Python Mock.filename方法代码示例

本文整理汇总了Python中webkitpy.thirdparty.mock.Mock.filename方法的典型用法代码示例。如果您正苦于以下问题:Python Mock.filename方法的具体用法?Python Mock.filename怎么用?Python Mock.filename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在webkitpy.thirdparty.mock.Mock的用法示例。


在下文中一共展示了Mock.filename方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_changelog_contains_oops

# 需要导入模块: from webkitpy.thirdparty.mock import Mock [as 别名]
# 或者: from webkitpy.thirdparty.mock.Mock import filename [as 别名]
    def test_changelog_contains_oops(self):
        tool = MockTool()
        tool._checkout.is_path_to_changelog = lambda path: True
        step = ValidateChangeLogs(tool, MockOptions(git_commit=None, non_interactive=True, check_oops=True))
        diff_file = Mock()
        diff_file.filename = "mock/ChangeLog"
        diff_file.lines = [(1, 1, "foo"), (2, 2, "bar OOPS! bar"), (3, 3, "foo")]
        self.assertTrue(OutputCapture().assert_outputs(self, step._changelog_contains_oops, [diff_file], expected_logs=''))

        diff_file.lines = [(1, 1, "foo"), (2, 2, "bar OOPS bar"), (3, 3, "foo")]
        self.assertFalse(OutputCapture().assert_outputs(self, step._changelog_contains_oops, [diff_file], expected_logs=''))
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:13,代码来源:validatechangelogs_unittest.py

示例2: _assert_start_line_produces_output

# 需要导入模块: from webkitpy.thirdparty.mock import Mock [as 别名]
# 或者: from webkitpy.thirdparty.mock.Mock import filename [as 别名]
 def _assert_start_line_produces_output(self, start_line, should_fail=False, non_interactive=False):
     tool = MockTool()
     step = ValidateChangeLogs(tool, MockOptions(git_commit=None, non_interactive=non_interactive))
     diff_file = Mock()
     diff_file.filename = "mock/ChangeLog"
     diff_file.lines = [(start_line, start_line, "foo")]
     expected_stdout = expected_stderr = expected_logs = ""
     if should_fail and not non_interactive:
         expected_logs = "The diff to mock/ChangeLog looks wrong. Are you sure your ChangeLog entry is at the top of the file?\nOK to continue?\n"
     result = OutputCapture().assert_outputs(self, step._check_changelog_diff, [diff_file], expected_logs=expected_logs)
     self.assertEqual(not result, should_fail)
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:13,代码来源:validatechangelogs_unittest.py

示例3: _assert_start_line_produces_output

# 需要导入模块: from webkitpy.thirdparty.mock import Mock [as 别名]
# 或者: from webkitpy.thirdparty.mock.Mock import filename [as 别名]
 def _assert_start_line_produces_output(self, start_line, should_prompt_user=False):
     tool = MockTool()
     tool._checkout.is_path_to_changelog = lambda path: True
     step = ValidateChangeLogs(tool, MockOptions(git_commit=None))
     diff_file = Mock()
     diff_file.filename = "mock/ChangeLog"
     diff_file.lines = [(start_line, start_line, "foo")]
     expected_stdout = expected_stderr = ""
     if should_prompt_user:
         expected_stdout = "OK to continue?\n"
         expected_stderr = "The diff to mock/ChangeLog looks wrong.  Are you sure your ChangeLog entry is at the top of the file?\n"
     OutputCapture().assert_outputs(self, step._check_changelog_diff, [diff_file], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
开发者ID:,项目名称:,代码行数:14,代码来源:

示例4: archive_last_test_results

# 需要导入模块: from webkitpy.thirdparty.mock import Mock [as 别名]
# 或者: from webkitpy.thirdparty.mock.Mock import filename [as 别名]
 def archive_last_test_results(self, patch):
     _log.info("archive_last_test_results: patch='%s'" % patch.id())
     archive = Mock()
     archive.filename = "mock-archive-%s.zip" % patch.id()
     return archive
开发者ID:edcwconan,项目名称:webkit,代码行数:7,代码来源:commitqueuetask_unittest.py


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