@test.create_stubs({api.network: ('security_group_rule_create',
                                      'security_group_list',
                                      'security_group_backend')})
    def _add_security_group_rule_fixture(self, **kwargs):
        sec_group = self.security_groups.first()
        sec_group_list = self.security_groups.list()
        rule = self.security_group_rules.first()

        api.network.security_group_backend(
            IsA(http.HttpRequest)).AndReturn(self.secgroup_backend)
        api.network.security_group_rule_create(
            IsA(http.HttpRequest),
            kwargs.get('sec_group', sec_group.id),
            kwargs.get('ingress', 'ingress'),
            kwargs.get('ethertype', 'IPv4'),
            kwargs.get('ip_protocol', rule.ip_protocol),
            kwargs.get('from_port', int(rule.from_port)),
            kwargs.get('to_port', int(rule.to_port)),
            kwargs.get('cidr', rule.ip_range['cidr']),
            kwargs.get('security_group', sec_group.id % u'%s')).AndReturn(rule)
        api.network.security_group_list(
            IsA(http.HttpRequest)).AndReturn(sec_group_list)
        return sec_group, rule
dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/dashboards/project/access_and_security/security_groups/tests.py/SecurityGroupsViewTests._add_security_group_rule_fixture/swapped operands of `%`