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

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

Issue 2608923002: [WPT Export] Delete remote branch, add label, additional refactoring (Closed)
Patch Set: Address CL feedback Created 3 years, 11 months 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 class MockWPTGitHub(object): 1 class MockWPTGitHub(object):
2 2
3 def __init__(self, pull_requests, unsuccessful_merge=False): 3 def __init__(self, pull_requests, unsuccessful_merge=False):
4 self.pull_requests = pull_requests 4 self.pull_requests = pull_requests
5 self.unsuccessful_merge = unsuccessful_merge 5 self.unsuccessful_merge = unsuccessful_merge
6 self.calls = [] 6 self.calls = []
7 self.pull_requests_created = [] 7 self.pull_requests_created = []
8 8
9 def in_flight_pull_requests(self): 9 def in_flight_pull_requests(self):
10 self.calls.append('in_flight_pull_requests') 10 self.calls.append('in_flight_pull_requests')
11 return self.pull_requests 11 return self.pull_requests
12 12
13 def merge_pull_request(self, number): 13 def merge_pull_request(self, number):
14 self.calls.append('merge_pull_request') 14 self.calls.append('merge_pull_request')
15 if self.unsuccessful_merge: 15 if self.unsuccessful_merge:
16 raise Exception('PR could not be merged: %d' % number) 16 raise Exception('PR could not be merged: %d' % number)
17 17
18 def create_pr(self, local_branch_name, desc_title, body): 18 def create_pr(self, remote_branch_name, desc_title, body):
19 self.calls.append('create_pr') 19 self.calls.append('create_pr')
20 20
21 assert local_branch_name 21 assert remote_branch_name
22 assert desc_title 22 assert desc_title
23 assert body 23 assert body
24 24
25 self.pull_requests_created.append((local_branch_name, desc_title, body)) 25 self.pull_requests_created.append((remote_branch_name, desc_title, body) )
26 26
27 return {} 27 return {}
28
29 def delete_remote_branch(self, _):
30 self.calls.append('delete_remote_branch')
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698