def test_mark_bug_fixed(self): tool = MockTool() tool._scm.last_svn_commit_log = lambda: "r9876 |" options = Mock() options.bug_id = 50000 options.comment = "MOCK comment" 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? Adding comment to Bug 50000. MOCK bug comment: bug_id=50000, cc=None, see_also=None --- Begin comment --- MOCK comment Committed r9876 (5@main): <https://commits.webkit.org/5@main> --- End comment --- """ with mocks.Requests( 'commits.webkit.org', **{ 'r9876/json': mocks.Response.fromJson( dict( identifier='5@main', revision=9876, )), }): self.assert_execute_outputs(MarkBugFixed(), [], expected_logs=expected_logs, tool=tool, options=options)
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 ---\nMOCK 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_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--- WebKitTools/Begin comment ---\\MOCK comment\n\nCommitted r9876: <http://trac.webkit.org/changeset/9876>\n--- WebKitTools/End comment ---\n\n" self.assert_execute_outputs(MarkBugFixed(), [], expected_stderr=expected_stderr, tool=tool, options=options)
def test_upload(self): options = Mock() options.description = "MOCK description" options.request_commit = False options.review = True options.comment = None options.cc = None expected_stderr = """Running check-webkit-style MOCK: user.open_url: file://... Obsoleting 2 old patches on bug 42 MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False -- Begin comment -- None -- End comment -- MOCK: user.open_url: http://example.com/42 """ self.assert_execute_outputs(Upload(), [42], options=options, expected_stderr=expected_stderr)
def test_mark_bug_fixed(self): tool = MockTool() tool._scm.last_svn_commit_log = lambda: "r9876 |" 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. Revision: 9876 MOCK: user.open_url: http://example.com/50000 Is this correct? Adding comment to Bug 50000. MOCK bug comment: bug_id=50000, cc=None --- Begin comment --- MOCK comment Committed r9876: <http://trac.webkit.org/changeset/9876> --- End comment --- """ self.assert_execute_outputs(MarkBugFixed(), [], expected_stderr=expected_stderr, tool=tool, options=options)
def test_mark_bug_fixed(self): tool = MockTool() tool._scm.last_svn_commit_log = lambda: "r9876 |" options = Mock() options.bug_id = 50000 options.comment = "MOCK comment" 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? Adding comment to Bug 50000. MOCK bug comment: bug_id=50000, cc=None, see_also=None --- Begin comment --- MOCK comment Committed r9876: <https://trac.webkit.org/changeset/9876> --- End comment --- """ self.assert_execute_outputs(MarkBugFixed(), [], expected_logs=expected_logs, tool=tool, options=options)