#NEWLINE# def test_noUsername( self ) : #NEWLINE# #INDENT# '\n        L{DigestCredentialFactory.decode} raises L{LoginFailed} if the response\n        has no username field or if the username field is empty.\n        ' #NEWLINE# e = self . assertRaises ( LoginFailed , self . credentialFactory . decode , self . formatResponse ( username = None ) , self . method , self . clientAddress . host ) #NEWLINE# self . assertEqual ( str ( e ) , 'Invalid response, no username given.' ) #NEWLINE# e = self . assertRaises ( LoginFailed , self . credentialFactory . decode , self . formatResponse ( username = '' ) , self . method , self . clientAddress . host ) #NEWLINE# self . assertEqual ( str ( e ) , 'Invalid response, no username given.' )