# Path: freezer_api/common/exceptions.py
# class FreezerAPIException(falcon.HTTPError):
# class BadDataFormat(FreezerAPIException):
# class DocumentExists(FreezerAPIException):
# class StorageEngineError(FreezerAPIException):
# class DocumentNotFound(FreezerAPIException):
# class AccessForbidden(FreezerAPIException):
# class MethodNotImplemented(FreezerAPIException):
#     def __init__(self, message=''):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
# 
# 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 unittest import mock
from unittest.mock import patch
from freezer_api.common import exceptions as freezer_api_exc
from freezer_api.tests.unit import common
from freezer_api.tests.unit.sqlalchemy import base
                doc['max_retries'] = 10
            result = self.dbapi.add_action(user_id=self.fake_action_3.
                                           get('user_id'),
                                           doc=doc,
                                           project_id=self.fake_project_id)

            self.assertIsNotNone(result)
            self.assertEqual(result, action_id)
            actionids.append(action_id)
            count += 1

        search_opt = {'match': [{'_all': '[{"max_retries": 10}]'}]}
        result = self.dbapi.search_action(project_id=self.fake_project_id,
                                          user_id=self.fake_action_3.
                                          get('user_id'),
                                          limit=20,
                                          offset=0,
                                          search=search_opt)

        self.assertIsNotNone(result)
        self.assertEqual(len(result), 5)
        for index in range(len(result)):
            actionmap = result[index]
            self.assertEqual(10, actionmap['max_retries'])

    def test_action_list_with_search_with_all_opt_two_matchs(self):
        count = 0
        actionids = []
        while (count < 20):
            doc = copy.deepcopy(self.fake_action_3)

# Path: freezer_api/common/exceptions.py
# class FreezerAPIException(falcon.HTTPError):
# class BadDataFormat(FreezerAPIException):
# class DocumentExists(FreezerAPIException):
# class StorageEngineError(FreezerAPIException):
# class DocumentNotFound(FreezerAPIException):
# class AccessForbidden(FreezerAPIException):
# class MethodNotImplemented(FreezerAPIException):
#     def __init__(self, message=''):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
# 
# 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_action.py
import copy
from unittest import mock
from unittest.mock import patch
from freezer_api.common import exceptions as freezer_api_exc
from freezer_api.tests.unit import common
from freezer_api.tests.unit.sqlalchemy import base

                doc['max_retries'] = 10
            result = self.dbapi.add_action(user_id=self.fake_action_3.
                                           get('user_id'),
                                           doc=doc,
                                           project_id=self.fake_project_id)

            self.assertIsNotNone(result)
            self.assertEqual(result, action_id)
            actionids.append(action_id)
            count += 1

        search_opt = {'match': [{'_all': '[{"max_retries": 10}]'}]}
        result = self.dbapi.search_action(project_id=self.fake_project_id,
                                          user_id=self.fake_action_3.
                                          get('user_id'),
                                          limit=20,
                                          offset=0,
                                          search=search_opt)

        self.assertIsNotNone(result)
        self.assertEqual(len(result), 5)
        for index in range(len(result)):
            actionmap = result[index]
            self.assertEqual(10, actionmap['max_retries'])

    def test_action_list_with_search_with_all_opt_two_matchs(self):
        count = 0
        actionids = []
        while (count < 20):
            doc = copy.deepcopy(self.fake_action_3)

            action_id = common.get_fake_action_id()