#NEWLINE# def assertKeypairRaises( self , exc_class , expected_message , name ) : #NEWLINE# #INDENT# func = getattr ( self . keypair_api , args . func_name ) #NEWLINE# args = [ ] #NEWLINE# if ( self . func_name == 'import_key_pair' ) : #NEWLINE# #INDENT# args . append ( self . pub_key ) #NEWLINE# #UNINDENT# args . append ( self . keypair_type ) #NEWLINE# exc = self . assertRaises ( exc_class , func , self . ctxt , self . ctxt . user_id , name , * args ) #NEWLINE# self . assertEqual ( expected_message , six . text_type ( exc ) )