#NEWLINE# @ fake_tasks ( override_state = { #NEWLINE# #INDENT# 'progress' : 100 , #NEWLINE# 'status' : 'ready' , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_deployment_task_managers( self ) : #NEWLINE# #INDENT# cluster = self . env . create ( nodes_kwargs = [ { #NEWLINE# #INDENT# 'pending_addition' : True , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'pending_deletion' : True , #NEWLINE# 'status' : NODE_STATUSES . provisioned , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# supertask = self . env . launch_deployment ( cluster [ 'id' ] ) #NEWLINE# self . env . refresh_nodes ( ) #NEWLINE# self . assertEqual ( supertask . name , TASK_NAMES . deploy ) #NEWLINE# self . assertEqual ( supertask . status , consts . TASK_STATUSES . ready ) #NEWLINE# self . assertEqual ( len ( supertask . subtasks ) , 3 ) #NEWLINE# provision_task = filter ( ( lambda t : ( t . name == TASK_NAMES . provision ) ) , supertask . subtasks ) [ 0 ] #NEWLINE# self . assertEqual ( provision_task . weight , 0.4 ) #NEWLINE# cluster_name = cluster [ 'name' ] #NEWLINE# self . assertIn ( 'Successfully removed 1 node(s). No errors occurred' , supertask . message ) #NEWLINE# self . assertIn ( "Provision of environment '{0}' is done." . format ( cluster_name ) , supertask . message ) #NEWLINE# self . assertIn ( "Deployment of environment '{0}' is done." . format ( cluster_name ) , supertask . message ) #NEWLINE# self . env . refresh_nodes ( ) #NEWLINE# for n in filter ( ( lambda n : ( n . cluster_id == cluster [ 'id' ] ) ) , self . env . nodes ) : #NEWLINE# #INDENT# self . assertEqual ( n . status , NODE_STATUSES . ready ) #NEWLINE# self . assertEqual ( n . progress , 100 )