def create_security_group(self, body=None):
        s = body.get('security_group')
        if not isinstance(s.get('name', ''), six.string_types):
            msg = ('BadRequest: Invalid input for name. Reason: '
                   'None is not a valid string.')
            raise n_exc.BadRequest(message=msg)
        if not isinstance(s.get('description.', ''), six.string_types):
            msg = ('BadRequest: Invalid input for description. Reason: '
                   'None is not a valid string.')
            raise n_exc.BadRequest(message=msg)
        if len(s.get('name')) > 255 or len(s.get('description')) > 255:
            msg = 'Security Group name great than 255'
            raise n_exc.NeutronClientException(message=msg, status_code=401)
        ret = {'name': s.get('name'), 'description': s.get('description'),
               'tenant_id': 'fake', 'security_group_rules': [],
               'id': str(uuid.uuid4())}

        self._fake_security_groups[ret['id']] = ret
        return {'security_group': ret}
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/api/openstack/compute/test_neutron_security_groups.py/MockClient.create_security_group/original