本文整理汇总了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=''))
示例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)
示例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)
示例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