diff options
Diffstat (limited to 'Tools/Scripts/webkitpy/tool/commands/upload_unittest.py')
-rw-r--r-- | Tools/Scripts/webkitpy/tool/commands/upload_unittest.py | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py b/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py index 185bb97f3..ad1b591e0 100644 --- a/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py +++ b/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py @@ -42,7 +42,7 @@ class UploadCommandsTest(CommandsTest): def test_assign_to_committer(self): tool = MockTool() - expected_stderr = """Warning, attachment 10001 on bug 50000 has invalid committer (non-committer@example.com) + expected_logs = """Warning, attachment 10001 on bug 50000 has invalid committer (non-committer@example.com) MOCK reassign_bug: bug_id=50000, assignee=eric@webkit.org -- Begin comment -- Attachment 10001 was posted by a committer and has review+, assigning to Eric Seidel for commit. @@ -50,11 +50,11 @@ Attachment 10001 was posted by a committer and has review+, assigning to Eric Se Bug 50003 is already assigned to foo@foo.com (None). Bug 50002 has no non-obsolete patches, ignoring. """ - self.assert_execute_outputs(AssignToCommitter(), [], expected_stderr=expected_stderr, tool=tool) + self.assert_execute_outputs(AssignToCommitter(), [], expected_logs=expected_logs, tool=tool) def test_obsolete_attachments(self): - expected_stderr = "Obsoleting 2 old patches on bug 50000\n" - self.assert_execute_outputs(ObsoleteAttachments(), [50000], expected_stderr=expected_stderr) + expected_logs = "Obsoleting 2 old patches on bug 50000\n" + self.assert_execute_outputs(ObsoleteAttachments(), [50000], expected_logs=expected_logs) def test_post(self): options = MockOptions() @@ -66,44 +66,46 @@ Bug 50002 has no non-obsolete patches, ignoring. options.request_commit = False options.review = True options.suggest_reviewers = False - expected_stderr = """MOCK: user.open_url: file://... + expected_logs = """MOCK: user.open_url: file://... Was that diff correct? Obsoleting 2 old patches on bug 50000 MOCK reassign_bug: bug_id=50000, assignee=None MOCK add_patch_to_bug: bug_id=50000, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False MOCK: user.open_url: http://example.com/50000 """ - self.assert_execute_outputs(Post(), [50000], options=options, expected_stderr=expected_stderr) + self.assert_execute_outputs(Post(), [50000], options=options, expected_logs=expected_logs) def test_attach_to_bug(self): options = MockOptions() options.comment = "extra comment" options.description = "file description" - expected_stderr = """MOCK add_attachment_to_bug: bug_id=50000, description=file description filename=None mimetype=None + expected_logs = """MOCK add_attachment_to_bug: bug_id=50000, description=file description filename=None mimetype=None -- Begin comment -- extra comment -- End comment -- """ - self.assert_execute_outputs(AttachToBug(), [50000, "path/to/file.txt", "file description"], options=options, expected_stderr=expected_stderr) + self.assert_execute_outputs(AttachToBug(), [50000, "path/to/file.txt", "file description"], options=options, expected_logs=expected_logs) def test_attach_to_bug_no_description_or_comment(self): options = MockOptions() options.comment = None options.description = None - expected_stderr = """MOCK add_attachment_to_bug: bug_id=50000, description=file.txt filename=None mimetype=None -""" - self.assert_execute_outputs(AttachToBug(), [50000, "path/to/file.txt"], options=options, expected_stderr=expected_stderr) + expected_logs = "MOCK add_attachment_to_bug: bug_id=50000, description=file.txt filename=None mimetype=None\n" + self.assert_execute_outputs(AttachToBug(), [50000, "path/to/file.txt"], options=options, expected_logs=expected_logs) def test_land_safely(self): - expected_stderr = "Obsoleting 2 old patches on bug 50000\nMOCK reassign_bug: bug_id=50000, assignee=None\nMOCK add_patch_to_bug: bug_id=50000, description=Patch for landing, mark_for_review=False, mark_for_commit_queue=False, mark_for_landing=True\n" - self.assert_execute_outputs(LandSafely(), [50000], expected_stderr=expected_stderr) + expected_logs = """Obsoleting 2 old patches on bug 50000 +MOCK reassign_bug: bug_id=50000, assignee=None +MOCK add_patch_to_bug: bug_id=50000, description=Patch for landing, mark_for_review=False, mark_for_commit_queue=False, mark_for_landing=True +""" + self.assert_execute_outputs(LandSafely(), [50000], expected_logs=expected_logs) def test_prepare_diff_with_arg(self): self.assert_execute_outputs(Prepare(), [50000]) def test_prepare(self): - expected_stderr = "MOCK create_bug\nbug_title: Mock user response\nbug_description: Mock user response\ncomponent: MOCK component\ncc: MOCK cc\n" - self.assert_execute_outputs(Prepare(), [], expected_stderr=expected_stderr) + expected_logs = "MOCK create_bug\nbug_title: Mock user response\nbug_description: Mock user response\ncomponent: MOCK component\ncc: MOCK cc\n" + self.assert_execute_outputs(Prepare(), [], expected_logs=expected_logs) def test_upload(self): options = MockOptions() @@ -115,14 +117,14 @@ extra comment options.request_commit = False options.review = True options.suggest_reviewers = False - expected_stderr = """MOCK: user.open_url: file://... + expected_logs = """MOCK: user.open_url: file://... Was that diff correct? Obsoleting 2 old patches on bug 50000 MOCK reassign_bug: bug_id=50000, assignee=None MOCK add_patch_to_bug: bug_id=50000, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False MOCK: user.open_url: http://example.com/50000 """ - self.assert_execute_outputs(Upload(), [50000], options=options, expected_stderr=expected_stderr) + self.assert_execute_outputs(Upload(), [50000], options=options, expected_logs=expected_logs) def test_mark_bug_fixed(self): tool = MockTool() @@ -130,7 +132,7 @@ MOCK: user.open_url: http://example.com/50000 options = Mock() options.bug_id = 50000 options.comment = "MOCK comment" - expected_stderr = """Bug: <http://example.com/50000> Bug with two r+'d and cq+'d patches, one of which has an invalid commit-queue setter. + expected_logs = """Bug: <http://example.com/50000> Bug with two r+'d and cq+'d patches, one of which has an invalid commit-queue setter. Revision: 9876 MOCK: user.open_url: http://example.com/50000 Is this correct? @@ -143,7 +145,7 @@ Committed r9876: <http://trac.webkit.org/changeset/9876> --- End comment --- """ - self.assert_execute_outputs(MarkBugFixed(), [], expected_stderr=expected_stderr, tool=tool, options=options) + self.assert_execute_outputs(MarkBugFixed(), [], expected_logs=expected_logs, tool=tool, options=options) def test_edit_changelog(self): self.assert_execute_outputs(EditChangeLogs(), []) |