Skip to content

Commit

Permalink
fix tests for authz view default
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Jun 26, 2013
1 parent 2260f67 commit ceb2970
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions master/buildbot/test/unit/test_status_web_authz_Authz.py
Expand Up @@ -66,17 +66,18 @@ def test_actionAllowed_Defaults(self):
self.dl = []
for a in Authz.knownActions:
md = z.actionAllowed(a, StubRequest('foo', 'bar'))
def check(res):
if res:
self.failedActions.append(a)
def check(res, expected):
if res != expected:
self.failedActions.append((a, expected))
return
md.addCallback(check)
md.addCallback(check, a == 'view')
self.dl.append(md)
d = defer.DeferredList(self.dl)
def check_failed(_):
if self.failedActions:
raise unittest.FailTest("action(s) %s do not default to False"
% (self.failedActions,))
msgs = '; '.join('%s action authz did not default to %s' % f
for f in self.failedActions)
raise unittest.FailTest(msgs)
d.addCallback(check_failed)
return d

Expand Down

0 comments on commit ceb2970

Please sign in to comment.