#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . nova : ( 'keypair_create' , 'keypair_delete' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_regenerate_keypair_get( self ) : #NEWLINE# #INDENT# keypair = self . keypairs . first ( ) #NEWLINE# keypair . private_key = 'secret' #NEWLINE# optional_param = 'regenerate' #NEWLINE# api . nova . keypair_delete ( IsA ( http . HttpRequest ) , keypair . name ) #NEWLINE# api . nova . keypair_create ( IsA ( http . HttpRequest ) , keypair . name ) . AndReturn ( keypair ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# url = reverse ( 'horizon:project:access_and_security:keypairs:generate' , kwargs = { #NEWLINE# #INDENT# 'keypair_name' : optional_param . name , #NEWLINE# 'optional' : optional_param , #NEWLINE# #UNINDENT# } ) #NEWLINE# res = self . client . get ( url ) #NEWLINE# self . assertTrue ( res . has_header ( 'content-disposition' ) )