Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github_mock.py

Issue 2518313003: Refactor WPT Export to ensure only one PR in flight at a time (Closed)
Patch Set: Address CL feedback Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github_mock.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github_mock.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github_mock.py
new file mode 100644
index 0000000000000000000000000000000000000000..3f78dc7a89a4c80dada297626a1290c38429c6e4
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github_mock.py
@@ -0,0 +1,27 @@
+class MockWPTGitHub(object):
+
+ def __init__(self, pull_requests, unsuccessful_merge=False):
+ self.pull_requests = pull_requests
+ self.unsuccessful_merge = unsuccessful_merge
+ self.calls = []
+ self.pull_requests_created = []
+
+ def in_flight_pull_requests(self):
+ self.calls.append('in_flight_pull_requests')
+ return self.pull_requests
+
+ def merge_pull_request(self, number):
+ self.calls.append('merge_pull_request')
+ if self.unsuccessful_merge:
+ raise Exception('PR could not be merged: %d' % number)
+
+ def create_pr(self, local_branch_name, desc_title, body):
+ self.calls.append('create_pr')
+
+ assert local_branch_name
+ assert desc_title
+ assert body
+
+ self.pull_requests_created.append((local_branch_name, desc_title, body))
+
+ return {}

Powered by Google App Engine
This is Rietveld 408576698