#NEWLINE# @ fake_tasks ( override_state = { #NEWLINE# #INDENT# 'progress' : 100 , #NEWLINE# 'status' : 'ready' , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_role_unassignment_drops_changes( self ) : #NEWLINE# #INDENT# cluster = self . env . create ( nodes_kwargs = [ { #NEWLINE# #INDENT# 'pending_addition' : True , #NEWLINE# 'api' : True , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# supertask = self . env . launch_deployment ( ) #NEWLINE# self . assertEqual ( supertask . status , consts . TASK_STATUSES . ready ) #NEWLINE# new_node = self . env . create_node ( cluster_id = cluster . id , pending_addition = True , api = True ) #NEWLINE# self . app . put ( reverse ( 'NodeHandler' , kwargs = { #NEWLINE# #INDENT# 'obj_id' : new_node [ 'id' ] , #NEWLINE# #UNINDENT# } ) , jsonutils . dumps ( { #NEWLINE# #INDENT# 'cluster' : None , #NEWLINE# 'pending_addition' : False , #NEWLINE# 'pending_roles' : [ ] , #NEWLINE# #UNINDENT# } ) , headers = supertask . default_headers ) #NEWLINE# all_changes = self . db . query ( ClusterChanges ) . filter_by ( cluster_id = cluster . id , node_id = new_node [ 'id' ] ) . all ( ) #NEWLINE# self . assertEqual ( all_changes , [ ] )