<s> import ddt <EOL> import mock <EOL> from rally . plugins . openstack . scenarios . neutron import security_groups <EOL> from tests . unit import test <EOL> @ ddt . ddt <EOL> class NeutronSecurityGroup ( test . TestCase ) : <EOL> @ ddt . data ( <EOL> { } , <EOL> { "<STR_LIT>" : { } } , <EOL> { "<STR_LIT>" : { "<STR_LIT:description>" : "<STR_LIT>" } } , <EOL> ) <EOL> @ ddt . unpack <EOL> def test_create_and_list_security_groups ( <EOL> self , security_group_create_args = None ) : <EOL> neutron_scenario = security_groups . NeutronSecurityGroup ( ) <EOL> security_group_data = security_group_create_args or { } <EOL> neutron_scenario . _create_security_group = mock . Mock ( ) <EOL> neutron_scenario . _list_security_groups = mock . Mock ( ) <EOL> neutron_scenario . create_and_list_security_groups ( <EOL> security_group_create_args = security_group_create_args ) <EOL> neutron_scenario . _create_security_group . assert_called_once_with ( <EOL> ** security_group_data ) <EOL> neutron_scenario . _list_security_groups . assert_called_once_with ( ) <EOL> @ ddt . data ( <EOL> { } , <EOL> { "<STR_LIT>" : { } } , <EOL> { "<STR_LIT>" : { "<STR_LIT:description>" : "<STR_LIT>" } } , <EOL> ) <EOL> @ ddt . unpack <EOL> def test_create_and_delete_security_groups ( <EOL> self , security_group_create_args = None ) : <EOL> neutron_scenario = security_groups . NeutronSecurityGroup ( ) <EOL> security_group_data = security_group_create_args or { } <EOL> neutron_scenario . _create_security_group = mock . Mock ( ) <EOL> neutron_scenario . _delete_security_group = mock . Mock ( ) <EOL> neutron_scenario . create_and_delete_security_groups ( <EOL> security_group_create_args = security_group_create_args ) <EOL> neutron_scenario . _create_security_group . assert_called_once_with ( <EOL> ** security_group_data ) <EOL> neutron_scenario . _delete_security_group . assert_called_once_with ( <EOL> neutron_scenario . _create_security_group . return_value ) <EOL> @ ddt . data ( <EOL> { } , <EOL> { "<STR_LIT>" : { } } , <EOL> { "<STR_LIT>" : { "<STR_LIT:description>" : "<STR_LIT>" } } , <EOL> { "<STR_LIT>" : { } } , <EOL> { "<STR_LIT>" : { "<STR_LIT:description>" : "<STR_LIT>" } } , <EOL> ) <EOL> @ ddt . unpack <EOL> def test_create_and_update_security_groups ( <EOL> self , security_group_create_args = None , <EOL> security_group_update_args = None ) : <EOL> neutron_scenario = security_groups . NeutronSecurityGroup ( ) <EOL> security_group_data = security_group_create_args or { } <EOL> security_group_update_data = security_group_update_args or { } <EOL> neutron_scenario . _create_security_group = mock . Mock ( ) <EOL> neutron_scenario . _update_security_group = mock . Mock ( ) <EOL> neutron_scenario . create_and_update_security_groups ( <EOL> security_group_create_args = security_group_create_args , <EOL> security_group_update_args = security_group_update_args ) <EOL> neutron_scenario . _create_security_group . assert_called_once_with ( <EOL> ** security_group_data ) <EOL> neutron_scenario . _update_security_group . assert_called_once_with ( <EOL> neutron_scenario . _create_security_group . return_value , <EOL> ** security_group_update_data ) </s>
