

def test_create_add_existing_rules_by_group_id(self):
    sg = test_security_groups.security_group_template()
    req = fakes.HTTPRequest.blank('/v2/fake/os-security-groups')
    self.controller_sg.create(req, {
        'security_group': sg,
    })
    rule = test_security_groups.security_group_rule_template(group=self.sg1['id'], parent_group_id=self.sg2['id'])
    req = fakes.HTTPRequest.blank('/v2/fake/os-security-group-rules')
    self.controller.create(req, {
        'security_group_rule': rule,
    })
    self.assertRaises(webob.exc.HTTPBadRequest, self.controller.create, sg, {
        'security_group_rule': rule,
    })

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/api/openstack/compute/test_neutron_security_groups.py _TestNeutronSecurityGroupRulesBase.test_create_add_existing_rules_by_group_id/VarMisuse@117/182 `req`->`sg`