#NEWLINE# def test_create_and_delete_security_groups( self ) : #NEWLINE# #INDENT# fake_secgroups = [ fakes . FakeSecurityGroup ( None , None , 1 , 'uuid1' ) , fakes . FakeSecurityGroup ( None , None , 2 , 'uuid2' ) ] #NEWLINE# nova_scenario = security_group . NovaSecGroup ( self . context ) #NEWLINE# nova_scenario . _create_security_groups = mock . MagicMock ( return_value = fake_secgroups ) #NEWLINE# nova_scenario . _create_rules_for_security_group = mock . MagicMock ( ) #NEWLINE# nova_scenario . _delete_security_groups = mock . MagicMock ( ) #NEWLINE# security_group_count = 2 #NEWLINE# rules_per_security_group = 10 #NEWLINE# nova_scenario . create_and_delete_secgroups ( security_group_count , rules_per_security_group ) #NEWLINE# nova_scenario . _create_security_groups . assert_called_once_with ( security_group_count ) #NEWLINE# nova_scenario . _create_rules_for_security_group . assert_called_once_with ( fake_secgroups , rules_per_security_group ) #NEWLINE# nova_scenario . _delete_security_groups . assert_called_once_with ( fake_secgroups )