def setUp(self): super(TestShowSecurityGroupRuleNetwork, self).setUp() self.network.find_security_group_rule = mock.Mock( return_value=self._security_group_rule) # Get the command object to test self.cmd = security_group_rule.ShowSecurityGroupRule( self.app, self.namespace)
def setUp(self): super(TestShowSecurityGroupRuleCompute, self).setUp() self.app.client_manager.network_endpoint_enabled = False # Build a security group fake customized for this test. security_group_rules = [self._security_group_rule] security_group = {'rules': security_group_rules} self.compute.api.security_group_list = mock.Mock( return_value=[security_group], ) # Get the command object to test self.cmd = security_group_rule.ShowSecurityGroupRule(self.app, None)
def setUp(self): super(TestShowSecurityGroupRuleCompute, self).setUp() self.app.client_manager.network_endpoint_enabled = False # Build a security group fake customized for this test. security_group_rules = [self._security_group_rule._info] security_group = fakes.FakeResource(info=copy.deepcopy( {'rules': security_group_rules}), loaded=True) security_group.rules = security_group_rules self.compute.security_groups.list.return_value = [security_group] # Get the command object to test self.cmd = security_group_rule.ShowSecurityGroupRule(self.app, None)