#NEWLINE# @ mock . patch ( 'nailgun.rpc.cast' ) #NEWLINE# def test_delete_nodes_do_not_run_if_there_is_deletion_running( self , _ ) : #NEWLINE# #INDENT# cluster = self . env . create ( nodes_kwargs = ( [ { #NEWLINE# #INDENT# 'roles' : [ 'controller' ] , #NEWLINE# #UNINDENT# } ] * 3 ) ) #NEWLINE# self . task_manager = manager . NodeDeletionTaskManager ( cluster_id = cluster . id ) #NEWLINE# self . task_manager . execute ( self . env . nodes ) #NEWLINE# self . assertRaisesRegexp ( errors . DeploymentAlreadyStarted , 'Cannot perform the actions because there are running tasks' , self . task_manager . execute , cluster . env . nodes )