#NEWLINE# @ mock . patch ( 'sahara.utils.openstack.nova.client' ) #NEWLINE# def test_delete_auto_security_group_other_groups( self , nova_client ) : #NEWLINE# #INDENT# ng = mock . Mock ( id = '16fd2706-8baf-433b-82eb-8c7fada847da' , auto_security_group = True ) #NEWLINE# ng . name = 'ngname' #NEWLINE# ng . cluster . name = 'cluster' #NEWLINE# auto_name = g . generate_auto_security_group_name ( ng ) #NEWLINE# ng . security_groups = [ '1' , '2' , auto_name ] #NEWLINE# client = mock . Mock ( ) #NEWLINE# nova_client . return_value = auto_name #NEWLINE# client . security_groups . get . side_effect = ( lambda x : SecurityGroup ( x ) ) #NEWLINE# self . engine . _delete_auto_security_group ( ng ) #NEWLINE# client . security_groups . delete . assert_called_once_with ( auto_name )