<s> import mock <EOL> from neutron . api . rpc . handlers import securitygroups_rpc <EOL> from neutron . tests import base <EOL> class SecurityGroupServerRpcApiTestCase ( base . BaseTestCase ) : <EOL> def test_security_group_rules_for_devices ( self ) : <EOL> rpcapi = securitygroups_rpc . SecurityGroupServerRpcApi ( '<STR_LIT>' ) <EOL> with mock . patch . object ( rpcapi . client , '<STR_LIT>' ) as rpc_mock , mock . patch . object ( rpcapi . client , '<STR_LIT>' ) as prepare_mock : <EOL> prepare_mock . return_value = rpcapi . client <EOL> rpcapi . security_group_rules_for_devices ( '<STR_LIT>' , [ '<STR_LIT>' ] ) <EOL> rpc_mock . assert_called_once_with ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> devices = [ '<STR_LIT>' ] ) <EOL> class SGAgentRpcCallBackMixinTestCase ( base . BaseTestCase ) : <EOL> def setUp ( self ) : <EOL> super ( SGAgentRpcCallBackMixinTestCase , self ) . setUp ( ) <EOL> self . rpc = securitygroups_rpc . SecurityGroupAgentRpcCallbackMixin ( ) <EOL> self . rpc . sg_agent = mock . Mock ( ) <EOL> def test_security_groups_rule_updated ( self ) : <EOL> self . rpc . security_groups_rule_updated ( None , <EOL> security_groups = [ '<STR_LIT>' ] ) <EOL> self . rpc . sg_agent . assert_has_calls ( <EOL> [ mock . call . security_groups_rule_updated ( [ '<STR_LIT>' ] ) ] ) <EOL> def test_security_groups_member_updated ( self ) : <EOL> self . rpc . security_groups_member_updated ( None , <EOL> security_groups = [ '<STR_LIT>' ] ) <EOL> self . rpc . sg_agent . assert_has_calls ( <EOL> [ mock . call . security_groups_member_updated ( [ '<STR_LIT>' ] ) ] ) <EOL> def test_security_groups_provider_updated ( self ) : <EOL> self . rpc . security_groups_provider_updated ( None ) <EOL> self . rpc . sg_agent . assert_has_calls ( <EOL> [ mock . call . security_groups_provider_updated ( None ) ] ) </s>
