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

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: Add label 'Automated Chromium Export' to all new PRs 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..27fb6b1fe5df1c93e013d07cbc6b30ffc50ddfc9
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github_mock.py
@@ -0,0 +1,34 @@
+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):
+ """Creates a PR on GitHub.
foolip 2016/11/29 11:12:21 Copying the documentation here doesn't seem useful
+
+ API doc: https://developer.github.com/v3/pulls/#create-a-pull-request
+
+ Returns:
+ A raw response object if successful, None if not.
+ """
+ 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