Skip to content

Commit

Permalink
Fix flake8 code style errors
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilioPeJu committed Jun 23, 2017
1 parent eed6444 commit 484ecd8
Show file tree
Hide file tree
Showing 4 changed files with 576 additions and 573 deletions.
18 changes: 9 additions & 9 deletions master/buildbot/reporters/stash.py
Expand Up @@ -43,11 +43,11 @@ class StashStatusPush(http.HttpStatusPushBase):
name = "StashStatusPush"

@defer.inlineCallbacks
def reconfigService(self, base_url, user, password, key=None, statusName=None,
startDescription=None, endDescription=None,
verbose=False, **kwargs):
yield http.HttpStatusPushBase.reconfigService(self, wantProperties=True,
**kwargs)
def reconfigService(self, base_url, user, password, key=None,
statusName=None, startDescription=None,
endDescription=None, verbose=False, **kwargs):
yield http.HttpStatusPushBase.reconfigService(
self, wantProperties=True, **kwargs)
self.key = key or Interpolate('%(prop:buildername)s')
self.statusName = statusName
self.endDescription = endDescription or 'Build done.'
Expand Down Expand Up @@ -111,8 +111,8 @@ class StashPRCommentPush(http.HttpStatusPushBase):
@defer.inlineCallbacks
def reconfigService(self, base_url, user, password, text=None,
verbose=False, **kwargs):
yield http.HttpStatusPushBase.reconfigService(self, wantProperties=True,
**kwargs)
yield http.HttpStatusPushBase.reconfigService(
self, wantProperties=True, **kwargs)
self.text = text or Interpolate('Builder: %(prop:buildername)s '
'Status: %(prop:statustext)s')
self.verbose = verbose
Expand All @@ -135,9 +135,9 @@ def sendPullRequestComment(self, build):
props.setProperty('statustext', status, self.name)
props.setProperty('url', build['url'], self.name)
comment_text = yield props.render(self.text)
payload = {'text' : comment_text}
payload = {'text': comment_text}
response = yield self._http.post(
STASH_COMMENT_API_URL.format(path=path),json=payload)
STASH_COMMENT_API_URL.format(path=path), json=payload)

if response.code == HTTP_CREATED:
if self.verbose:
Expand Down
10 changes: 5 additions & 5 deletions master/buildbot/test/unit/test_reporter_stash.py
Expand Up @@ -177,8 +177,8 @@ def test_basic(self):
build = yield self.setupBuildResults(SUCCESS)
self._http.expect(
"post",
u'/rest/api/1.0/projects/PRO/repos/myrepo/pull-requests/20/comments',
json={"text" : "Builder: Builder0 Status: SUCCESS"},
u'/rest/api/1.0/projects/PRO/repos/myrepo/pull-requests/20/comments',
json={"text": "Builder: Builder0 Status: SUCCESS"},
code=201)
build["complete"] = False
# this shouldn't send anything
Expand All @@ -189,7 +189,7 @@ def test_basic(self):
self._http.expect(
"post",
u'/rest/api/1.0/projects/PRO/repos/myrepo/pull-requests/20/comments',
json={"text" : "Builder: Builder0 Status: FAILED"},
json={"text": "Builder: Builder0 Status: FAILED"},
code=201)
build["results"] = FAILURE
self.sp.buildFinished(("build", 20, "finished"), build)
Expand All @@ -200,7 +200,7 @@ def test_setting_options(self):
build = yield self.setupBuildResults(SUCCESS)
self._http.expect(
"post",
u'/rest/api/1.0/projects/PRO/repos/myrepo/pull-requests/20/comments',
u'/rest/api/1.0/projects/PRO/repos/myrepo/pull-requests/20/comments',
json={'text': 'url: http://localhost:8080/#builders/79/builds/0 status: SUCCESS'},
code=201)
build["complete"] = False
Expand All @@ -223,7 +223,7 @@ def test_error(self):
self._http.expect(
"post",
u'/rest/api/1.0/projects/PRO/repos/myrepo/pull-requests/20/comments',
json={"text" : "Builder: Builder0 Status: SUCCESS"},
json={"text": "Builder: Builder0 Status: SUCCESS"},
code=404,
content_json=None)
self.setUpLogging()
Expand Down

0 comments on commit 484ecd8

Please sign in to comment.