#NEWLINE# def testFailedLogin( self ) : #NEWLINE# #INDENT# l = [ ] #NEWLINE# self . portal . login ( credentials . UsernamePassword ( 'bob' , 'h3llo' ) , self , ITestable ) . addErrback ( ( lambda x : x . trap ( error . UnauthorizedLogin ) ) ) . addCallback ( l . append ) #NEWLINE# self . failUnless ( l ) #NEWLINE# self . failUnlessEqual ( error . UnauthorizedLogin , l [ 0 ] )