Skip to content

Commit

Permalink
minor style cleanup of change_hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin J. Mitchell committed Oct 6, 2010
1 parent 4e1d14e commit 5e920d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions master/buildbot/status/web/hooks/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ def process_change(payload, user, repo, repo_url):
else:
for commit in payload['commits']:
files = []
if 'added' in commit.keys():
if 'added' in commit:
files.extend(commit['added'])
if 'modified' in commit.keys():
if 'modified' in commit:
files.extend(commit['modified'])
if 'removed' in commit.keys():
if 'removed' in commit:
files.extend(commit['removed'])
when = convertTime( commit['timestamp'])
change = {'revision': commit['id'],
Expand Down
2 changes: 0 additions & 2 deletions master/buildbot/test/unit/test_status_web_change_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def setUp(self):
"revlink" : ["a revlink"],
"properties" : [json.dumps( { "prop1" : "val1", "prop2" : "val2" })],
"revision" : [99] }
#print changeDict
self.request = MockRequest(changeDict)
self.changeHook = change_hook.ChangeHookResource(dialects={'base' : True})

Expand All @@ -90,7 +89,6 @@ def testDefaultDialectWithChange(self):
ret = self.changeHook.render_GET(self.request)
# Change is an array of dicts holding changes. There will normally only be one
# changes, thus only one dictionary
#print ret
changeArray = json.loads(ret)
change = changeArray[0]
self.assertEquals(change["category"], "mycat")
Expand Down

0 comments on commit 5e920d5

Please sign in to comment.