#NEWLINE# def test_nodegroup_rename( self ) : #NEWLINE# #INDENT# self . assertEquals ( 1 , objects . NodeGroupCollection . get_by_cluster_id ( self . cluster [ 'id' ] ) . count ( ) ) #NEWLINE# resp = self . env . create_node_group ( name = 'nodegroup_to_be_renamed' ) #NEWLINE# self . assertEquals ( 201 , resp . status_code ) #NEWLINE# self . assertEquals ( self . cluster [ 'id' ] , resp . json_body [ 'cluster_id' ] ) #NEWLINE# self . assertEquals ( 2 , objects . NodeGroupCollection . get_by_cluster_id ( self . cluster [ 'id' ] ) . count ( ) ) #NEWLINE# nodegroup_name = 'test_ng_renamed' #NEWLINE# resp = self . app . put ( reverse ( 'NodeGroupHandler' , kwargs = { #NEWLINE# #INDENT# 'obj_id' : resp . json_body [ 'id' ] , #NEWLINE# #UNINDENT# } ) , json . dumps ( { #NEWLINE# #INDENT# 'cluster_id' : self . cluster [ 'id' ] , #NEWLINE# 'name' : nodegroup_name , #NEWLINE# #UNINDENT# } ) , headers = self . default_headers , expect_errors = False ) #NEWLINE# self . assertEquals ( 200 , resp . status_code ) #NEWLINE# self . assertEquals ( self . cluster [ 'id' ] , resp . json_body [ 'cluster_id' ] ) #NEWLINE# self . assertEquals ( 2 , objects . NodeGroupCollection . get_by_cluster_id ( self . cluster [ 'id' ] ) . count ( ) ) #NEWLINE# self . assertEquals ( 1 , objects . NodeGroupCollection . get_by_cluster_id ( self . cluster [ 'id' ] ) . filter_by ( name = nodegroup_name ) . count ( ) )