diff options
Diffstat (limited to 'WebKitTools/Scripts/webkitpy/tool/mocktool.py')
-rw-r--r-- | WebKitTools/Scripts/webkitpy/tool/mocktool.py | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/WebKitTools/Scripts/webkitpy/tool/mocktool.py b/WebKitTools/Scripts/webkitpy/tool/mocktool.py index e3d36ce..8a6188a 100644 --- a/WebKitTools/Scripts/webkitpy/tool/mocktool.py +++ b/WebKitTools/Scripts/webkitpy/tool/mocktool.py @@ -161,6 +161,7 @@ _bug1 = { "invalid commit-queue setter.", "assigned_to_email": _unassigned_email, "attachments": [_patch1, _patch2], + "bug_status": "UNCONFIRMED", } @@ -169,6 +170,7 @@ _bug2 = { "title": "Bug with a patch needing review.", "assigned_to_email": "foo@foo.com", "attachments": [_patch3], + "bug_status": "ASSIGNED", } @@ -177,6 +179,7 @@ _bug3 = { "title": "The third bug", "assigned_to_email": _unassigned_email, "attachments": [_patch7], + "bug_status": "NEW", } @@ -185,6 +188,7 @@ _bug4 = { "title": "The fourth bug", "assigned_to_email": "foo@foo.com", "attachments": [_patch4, _patch5, _patch6], + "bug_status": "REOPENED", } @@ -254,8 +258,8 @@ class MockBugzilla(Mock): def __init__(self): Mock.__init__(self) self.queries = MockBugzillaQueries(self) - self.committers = CommitterList(reviewers=[Reviewer("Foo Bar", - "foo@bar.com")]) + self.committers = CommitterList(reviewers=[Reviewer("Foo Bar", "foo@bar.com")]) + self._override_patch = None def create_bug(self, bug_title, @@ -277,7 +281,13 @@ class MockBugzilla(Mock): def fetch_bug(self, bug_id): return Bug(self.bug_cache.get(bug_id), self) + def set_override_patch(self, patch): + self._override_patch = patch + def fetch_attachment(self, attachment_id): + if self._override_patch: + return self._override_patch + # This could be changed to .get() if we wish to allow failed lookups. attachment_dictionary = self.attachment_cache[attachment_id] bug = self.fetch_bug(attachment_dictionary["bug_id"]) @@ -497,8 +507,9 @@ class MockIRC(object): class MockStatusServer(object): - def __init__(self): + def __init__(self, work_items=None): self.host = "example.com" + self._work_items = work_items or [] def patch_status(self, queue_name, patch_id): return None @@ -506,7 +517,13 @@ class MockStatusServer(object): def svn_revision(self, svn_revision): return None + def next_work_item(self, queue_name): + if not self._work_items: + return None + return self._work_items[0] + def update_work_items(self, queue_name, work_items): + self._work_items = work_items log("MOCK: update_work_items: %s %s" % (queue_name, work_items)) def update_status(self, queue_name, status, patch=None, results_file=None): |