def test_upload(self): options = Mock() options.description = "MOCK description" options.request_commit = False options.review = True expected_stderr = "Running check-webkit-style\nObsoleting 2 old patches on bug 42\nMOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False\n-- Begin comment --\nNone\n-- End comment --\nMOCK: user.open_url: http://example.com/42\n" self.assert_execute_outputs(Upload(), [42], options=options, expected_stderr=expected_stderr)
def test_commit_message_for_current_diff(self): tool = MockTool() mock_commit_message_for_this_commit = Mock() mock_commit_message_for_this_commit.message = lambda: "Mock message" tool._checkout.commit_message_for_this_commit = lambda: mock_commit_message_for_this_commit expected_stdout = "Mock message\n" self.assert_execute_outputs(CommitMessageForCurrentDiff(), [], expected_stdout=expected_stdout, tool=tool)
def test_mark_bug_fixed(self): tool = MockTool() tool._scm.last_svn_commit_log = lambda: "r9876 |" options = Mock() options.bug_id = 42 options.comment = "MOCK comment" expected_stderr = "Bug: <http://example.com/42> Bug with two r+'d and cq+'d patches, one of which has an invalid commit-queue setter.\nRevision: 9876\nMOCK: user.open_url: http://example.com/42\nAdding comment to Bug 42.\nMOCK bug comment: bug_id=42, cc=None\n--- Begin comment ---\\MOCK comment\n\nCommitted r9876: <http://trac.webkit.org/changeset/9876>\n--- End comment ---\n\n" self.assert_execute_outputs(MarkBugFixed(), [], expected_stderr=expected_stderr, tool=tool, options=options)
def test_patches_to_commit_queue(self): expected_stdout = "http://example.com/104&action=edit\n" expected_stderr = "197 already has cq=+\n128 already has cq=+\n105 committer = \"Eric Seidel\" <*****@*****.**>\n" options = Mock() options.bugs = False self.assert_execute_outputs(PatchesToCommitQueue(), None, expected_stdout, expected_stderr, options=options) expected_stdout = "http://example.com/77\n" options.bugs = True self.assert_execute_outputs(PatchesToCommitQueue(), None, expected_stdout, expected_stderr, options=options)
def _default_options(self): options = Mock() options.force_clean = False options.clean = True options.check_builders = True options.quiet = False options.non_interactive = False options.update = True options.build = True options.test = True options.close_bug = True return options