import sys
import json
import uuid
import logging

from testtools.matchers import Equals, Contains, Not
from testtools import content, content_type, ExpectedException

from vnc_api.vnc_api import *

sys.path.append('../common/tests')
from test_utils import *
import test_common

import test_case

logger = logging.getLogger(__name__)

class NBTestNaming(test_case.NeutronBackendTestCase):
    def _create_resource(self, res_type, proj_id, name=None, extra_res_fields=None):
        context = {'operation': 'CREATE',
                   'user_id': '',
                   'is_admin': False,
                   'roles': '',
                   'tenant_id': proj_id}
        if name:
            res_name = name
        else:
            res_name = '%s-%s' %(res_type, str(uuid.uuid4()))
        data = {'resource': {'name': res_name,
                             'tenant_id': proj_id}}
        if extra_res_fields:
            data['resource'].update(extra_res_fields)