#NEWLINE# def test_stop_locked_server( self ) : #NEWLINE# #INDENT# self . stub_out ( 'nova.db.instance_get_by_uuid' , fake_instance_get ) #NEWLINE# self . stubs . Set ( compute_api . API , 'stop' , fake_start_stop_locked_server ) #NEWLINE# body = dict ( stop = '' ) #NEWLINE# ex = self . assertRaises ( webob . exc . HTTPConflict , self . controller . _stop_server , ex . req , 'test_inst' , body ) #NEWLINE# self . assertIn ( 'is locked' , six . text_type ( ex ) )