#NEWLINE# def test_delete_raise_exception_keypair_inuse( self ) : #NEWLINE# #INDENT# self . mox . StubOutWithMock ( db , 'process_get_all' ) #NEWLINE# db . process_get_all ( IsA ( context . RequestContext ) , GID , filters = { #NEWLINE# #INDENT# 'keypair_id' : KEYPAIR_ID , #NEWLINE# #UNINDENT# } ) . AndReturn ( [ { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ] ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# url = ( ( ( '/v1/groups/' + GID ) + '/keypairs/' ) + KEYPAIR_ID ) #NEWLINE# req = get_request ( res , 'DELETE' ) #NEWLINE# res = req . get_response ( self . app ) #NEWLINE# self . assertEqual ( res . status_code , 409 )