#NEWLINE# @ fake_tasks ( recover_offline_nodes = False ) #NEWLINE# def test_deletion_offline_node( self ) : #NEWLINE# #INDENT# cluster = self . env . create ( nodes_kwargs = [ { #NEWLINE# #INDENT# 'online' : False , #NEWLINE# 'pending_deletion' : True , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'status' : 'ready' , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# to_delete = TaskHelper . nodes_to_delete ( cluster ) #NEWLINE# to_delete_ids = [ node . id for node in to_delete ] #NEWLINE# self . assertEqual ( len ( to_delete_ids ) , 1 ) #NEWLINE# supertask = self . env . launch_deployment ( ) #NEWLINE# self . assertEqual ( supertask . status , consts . TASK_STATUSES . ready ) #NEWLINE# self . assertEqual ( self . env . db . query ( models . Node ) . count ( ) , 1 ) #NEWLINE# remaining_node = self . env . db . query ( models . Node ) . first ( ) #NEWLINE# self . assertNotIn ( remaining_node . id , to_delete_ids )