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

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

Issue 2657523005: WPT Export: trim lines from branch list, stage changes before committing (Closed)
Patch Set: Fix unit test Created 3 years, 10 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/local_wpt_unittest.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 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import base64 5 import base64
6 import json 6 import json
7 import logging 7 import logging
8 import os 8 import os
9 import sys 9 import sys
10 import urllib2 10 import urllib2
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 path = '/repos/w3c/web-platform-tests/pulls/%d/merge' % pull_request_num ber 89 path = '/repos/w3c/web-platform-tests/pulls/%d/merge' % pull_request_num ber
90 body = {} 90 body = {}
91 data, status_code = self.request(path, method='PUT', body=body) 91 data, status_code = self.request(path, method='PUT', body=body)
92 92
93 if status_code == 200: 93 if status_code == 200:
94 return data 94 return data
95 else: 95 else:
96 raise Exception('PR could not be merged: %d' % pull_request_number) 96 raise Exception('PR could not be merged: %d' % pull_request_number)
97 97
98 def delete_remote_branch(self, remote_branch_name): 98 def delete_remote_branch(self, remote_branch_name):
99 # TODO(jeffcarp): Unit test this method
99 path = '/repos/w3c/web-platform-tests/git/refs/heads/%s' % remote_branch _name 100 path = '/repos/w3c/web-platform-tests/git/refs/heads/%s' % remote_branch _name
100 data, status_code = self.request(path, method='DELETE') 101 data, status_code = self.request(path, method='DELETE')
101 102
102 if status_code != 200: 103 if status_code != 204:
103 # TODO(jeffcarp): Raise more specific exception (create MergeError c lass?) 104 # TODO(jeffcarp): Raise more specific exception (create MergeError c lass?)
104 raise Exception('PR could not be merged') 105 raise Exception('Received non-204 status code attempting to delete r emote branch: {}'.format(status_code))
105 106
106 return data 107 return data
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/local_wpt_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698