# Path: freezer_api/tests/unit/common.py
# CONF = cfg.CONF
# def get_fake_backup_metadata():
# def get_fake_job_0():
# def get_fake_job_1():
# def get_fake_job_2():
# def get_fake_job_3():
# def get_fake_job_id():
# def get_fake_client_0():
# def get_fake_client_1():
# def get_fake_client_id():
# def get_fake_action_0():
# def get_fake_action_1():
# def get_fake_action_2():
# def get_fake_action_id():
# def get_fake_action_3():
# def get_fake_session_0():
# def get_fake_session_1():
# def get_fake_session_2():
# def get_fake_session_3():
# def get_fake_session_id():
#     def __init__(self, method='GET', body=''):
#     def get_header(self, key):
#     def setUp(self):
#     def __init__(self, *args, **kwargs):
#     def to_dict(self):
# def get_req_items(name):
# class FakeReqResp(object):
# class FreezerBaseTestCase(testtools.TestCase):
# class FakeContext(object):
# 
# Path: freezer_api/tests/unit/sqlalchemy/base.py
# CONF = cfg.CONF
# _DB_CACHE = None
# IN_MEM_DB_CONN_STRING = 'sqlite://'
#             _DB_CACHE = Database(sqla_api)
# class Database(fixtures.Fixture):
# class DbTestCase(common.FreezerBaseTestCase):
#     def __init__(self, db_api):
#     def initialize_sql_session(self, connection_str):
#     def setup_sqlite(self):
#     def setUp(self):
#     def setUp(self):


import copy
from freezer_api.tests.unit import common
from freezer_api.tests.unit.sqlalchemy import base
                                              project_id=self.fake_project_id)
            self.assertIsNotNone(client_id)
            self.assertEqual(clientid, client_id)
            clientids.append(client_id)
            count += 1

        search_opt = {'match_not': [{'hostname': 'node2'}],
                      'match': [{'description': 'tecs'}]}

        result = self.dbapi.get_client(project_id=self.fake_project_id,
                                       user_id=self.fake_user_id,
                                       limit=20,
                                       offset=0,
                                       search=search_opt)

        self.assertIsNotNone(result)
        self.assertEqual(len(result), 3)

        for index in range(len(result)):
            clientmap = result[index]
            hostname = clientmap['client'].get('hostname')
            description = clientmap['client'].get('description')
            self.assertEqual('node1', hostname)
            self.assertEqual('tecs', description)

    def test_add_and_search_client_with_search_match_list(self):
        count = 0
        clientids = []
        while (count < 20):
            client_doc = copy.deepcopy(self.fake_client_doc)

# Path: freezer_api/tests/unit/common.py
# CONF = cfg.CONF
# def get_fake_backup_metadata():
# def get_fake_job_0():
# def get_fake_job_1():
# def get_fake_job_2():
# def get_fake_job_3():
# def get_fake_job_id():
# def get_fake_client_0():
# def get_fake_client_1():
# def get_fake_client_id():
# def get_fake_action_0():
# def get_fake_action_1():
# def get_fake_action_2():
# def get_fake_action_id():
# def get_fake_action_3():
# def get_fake_session_0():
# def get_fake_session_1():
# def get_fake_session_2():
# def get_fake_session_3():
# def get_fake_session_id():
#     def __init__(self, method='GET', body=''):
#     def get_header(self, key):
#     def setUp(self):
#     def __init__(self, *args, **kwargs):
#     def to_dict(self):
# def get_req_items(name):
# class FakeReqResp(object):
# class FreezerBaseTestCase(testtools.TestCase):
# class FakeContext(object):
# 
# Path: freezer_api/tests/unit/sqlalchemy/base.py
# CONF = cfg.CONF
# _DB_CACHE = None
# IN_MEM_DB_CONN_STRING = 'sqlite://'
#             _DB_CACHE = Database(sqla_api)
# class Database(fixtures.Fixture):
# class DbTestCase(common.FreezerBaseTestCase):
#     def __init__(self, db_api):
#     def initialize_sql_session(self, connection_str):
#     def setup_sqlite(self):
#     def setUp(self):
#     def setUp(self):


# Path: freezer_api/tests/unit/sqlalchemy/v2/test_client.py
import copy
from freezer_api.tests.unit import common
from freezer_api.tests.unit.sqlalchemy import base

                                              project_id=self.fake_project_id)
            self.assertIsNotNone(client_id)
            self.assertEqual(clientid, client_id)
            clientids.append(client_id)
            count += 1

        search_opt = {'match_not': [{'hostname': 'node2'}],
                      'match': [{'description': 'tecs'}]}

        result = self.dbapi.get_client(project_id=self.fake_project_id,
                                       user_id=self.fake_user_id,
                                       limit=20,
                                       offset=0,
                                       search=search_opt)

        self.assertIsNotNone(result)
        self.assertEqual(len(result), 3)

        for index in range(len(result)):
            clientmap = result[index]
            hostname = clientmap['client'].get('hostname')
            description = clientmap['client'].get('description')
            self.assertEqual('node1', hostname)
            self.assertEqual('tecs', description)

    def test_add_and_search_client_with_search_match_list(self):
        count = 0
        clientids = []
        while (count < 20):
            client_doc = copy.deepcopy(self.fake_client_doc)

            clientid = common.get_fake_client_id()