#NEWLINE# def test_update_policy_target_group_subnets( self ) : #NEWLINE# #INDENT# with self . subnet ( cidr = '10.10.1.0/24' ) as subnet1 : #NEWLINE# #INDENT# with self . subnet ( cidr = '10.10.2.0/24' ) as subnet2 : #NEWLINE# #INDENT# with self . subnet ( cidr = '10.10.3.0/24' ) as subnet3 : #NEWLINE# #INDENT# orig_subnets = [ subnet1 [ 'subnet' ] [ 'id' ] , subnet2 [ 'subnet' ] [ 'id' ] ] #NEWLINE# ptg = self . create_policy_target_group ( subnets = orig_subnets ) #NEWLINE# ptg_id = ptg [ 'policy_target_group' ] [ 'id' ] #NEWLINE# self . assertEqual ( sorted ( subnet1 ) , sorted ( ptg [ 'policy_target_group' ] [ 'subnets' ] ) ) #NEWLINE# new_subnets = [ subnet1 [ 'subnet' ] [ 'id' ] , subnet3 [ 'subnet' ] [ 'id' ] ] #NEWLINE# data = { #NEWLINE# #INDENT# 'policy_target_group' : { #NEWLINE# #INDENT# 'subnets' : new_subnets , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# req = self . new_update_request ( 'policy_target_groups' , data , ptg_id ) #NEWLINE# res = self . deserialize ( self . fmt , req . get_response ( self . ext_api ) ) #NEWLINE# self . assertEqual ( sorted ( new_subnets ) , sorted ( res [ 'policy_target_group' ] [ 'subnets' ] ) ) #NEWLINE# req = self . new_show_request ( 'policy_target_groups' , ptg_id , fmt = self . fmt ) #NEWLINE# res = self . deserialize ( self . fmt , req . get_response ( self . ext_api ) ) #NEWLINE# self . assertEqual ( sorted ( new_subnets ) , sorted ( res [ 'policy_target_group' ] [ 'subnets' ] ) ) #NEWLINE# req = self . new_delete_request ( 'policy_target_groups' , ptg_id ) #NEWLINE# res = req . get_response ( self . ext_api ) #NEWLINE# self . assertEqual ( webob . exc . HTTPNoContent . code , res . status_int )