diff options
author | Ben Murdoch <benm@google.com> | 2011-05-13 16:23:25 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-16 11:35:02 +0100 |
commit | 65f03d4f644ce73618e5f4f50dd694b26f55ae12 (patch) | |
tree | f478babb801e720de7bfaee23443ffe029f58731 /Tools/Scripts/webkitpy/tool/steps/validatechangelogs_unittest.py | |
parent | 47de4a2fb7262c7ebdb9cd133ad2c54c187454d0 (diff) | |
download | external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.zip external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.gz external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.bz2 |
Merge WebKit at r75993: Initial merge by git.
Change-Id: I602bbdc3974787a3b0450456a30a7868286921c3
Diffstat (limited to 'Tools/Scripts/webkitpy/tool/steps/validatechangelogs_unittest.py')
-rw-r--r-- | Tools/Scripts/webkitpy/tool/steps/validatechangelogs_unittest.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Tools/Scripts/webkitpy/tool/steps/validatechangelogs_unittest.py b/Tools/Scripts/webkitpy/tool/steps/validatechangelogs_unittest.py index 66db793..db35a58 100644 --- a/Tools/Scripts/webkitpy/tool/steps/validatechangelogs_unittest.py +++ b/Tools/Scripts/webkitpy/tool/steps/validatechangelogs_unittest.py @@ -36,20 +36,24 @@ from webkitpy.tool.steps.validatechangelogs import ValidateChangeLogs class ValidateChangeLogsTest(unittest.TestCase): - def _assert_start_line_produces_output(self, start_line, should_prompt_user=False): + def _assert_start_line_produces_output(self, start_line, should_fail=False, non_interactive=False): tool = MockTool() tool._checkout.is_path_to_changelog = lambda path: True - step = ValidateChangeLogs(tool, MockOptions(git_commit=None)) + 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 = "" - if should_prompt_user: + if should_fail and not non_interactive: 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) + result = OutputCapture().assert_outputs(self, step._check_changelog_diff, [diff_file], expected_stdout=expected_stdout, expected_stderr=expected_stderr) + self.assertEqual(not result, should_fail) def test_check_changelog_diff(self): - self._assert_start_line_produces_output(1, should_prompt_user=False) - self._assert_start_line_produces_output(7, should_prompt_user=False) - self._assert_start_line_produces_output(8, should_prompt_user=True) + self._assert_start_line_produces_output(1) + self._assert_start_line_produces_output(7) + self._assert_start_line_produces_output(8, should_fail=True) + + self._assert_start_line_produces_output(1, non_interactive=False) + self._assert_start_line_produces_output(8, non_interactive=True, should_fail=True) |