#NEWLINE# def test_server_security_groups( self ) : #NEWLINE# #INDENT# cur_sg_ids = [ sg [ 'id' ] for sg in self . api_q_secgroups . list ( ) [ : 2 ] ] #NEWLINE# ( instance_id , instance_ports ) = self . _get_instance ( cur_sg_ids ) #NEWLINE# self . qclient . list_ports ( device_id = instance_id ) . AndReturn ( { #NEWLINE# #INDENT# 'ports' : instance_ports , #NEWLINE# #UNINDENT# } ) #NEWLINE# secgroups = copy . deepcopy ( self . api_q_secgroups . list ( ) ) #NEWLINE# self . qclient . list_security_groups ( id = set ( cur_sg_ids ) ) . AndReturn ( { #NEWLINE# #INDENT# 'security_groups' : secgroups , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# api . network . server_security_groups ( self . request , instance_id )