# Path: freezer_api/service.py
# CONF = cfg.CONF
# def root_app_factory(loader, global_conf, **local_conf):
# def freezer_appv1_factory(global_conf, **local_conf):
# def freezer_appv2_factory(global_conf, **local_conf):
# def initialize_app(conf=None, name='main'):
# 
# 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):


from unittest.mock import patch
from freezer_api import service
from freezer_api.tests.unit import common
import falcon

                named_args = kwargs.keys()

                self.assertNotIn('before', named_args)
                self.assertNotIn('after', named_args)
                self.assertIn('middleware', named_args)

    @patch('freezer_api.cmd.api.v2')
    @patch('freezer_api.cmd.api.manager')
    @patch('freezer_api.cmd.api.falcon')
    def test_on_old_falcon_builds_v2(self, mock_falcon, mock_driver, mock_v2):
        """Test that falcon versions that should use old middleware syntax do so

        :param mock_falcon: The falcon import freezer-api will try to
        start up
        :param mock_driver: Database driver
        :param mock_v1: List of endpoints for v1 for the freezer API.
        """
        mock_driver.get_db.return_value = None
        mock_v2.endpoints = []

        # Iterate through all of the versions of falcon that should be using
        # the old before=,after= invocation and ensure that freezer-api isn't
        # trying to invoke it in the old style.
        for version_string in self.falcon_versions_hooks:
            version_attribute = '__version__' if hasattr(
                falcon, '__version__') else 'version'
            with patch('falcon.' + version_attribute, version_string):
                # Attempt to invoke a mocked version of falcon to see what args
                # it was called with

# Path: freezer_api/service.py
# CONF = cfg.CONF
# def root_app_factory(loader, global_conf, **local_conf):
# def freezer_appv1_factory(global_conf, **local_conf):
# def freezer_appv2_factory(global_conf, **local_conf):
# def initialize_app(conf=None, name='main'):
# 
# 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/test_service.py
from unittest.mock import patch
from freezer_api import service
from freezer_api.tests.unit import common
import falcon


                named_args = kwargs.keys()

                self.assertNotIn('before', named_args)
                self.assertNotIn('after', named_args)
                self.assertIn('middleware', named_args)

    @patch('freezer_api.cmd.api.v2')
    @patch('freezer_api.cmd.api.manager')
    @patch('freezer_api.cmd.api.falcon')
    def test_on_old_falcon_builds_v2(self, mock_falcon, mock_driver, mock_v2):
        """Test that falcon versions that should use old middleware syntax do so

        :param mock_falcon: The falcon import freezer-api will try to
        start up
        :param mock_driver: Database driver
        :param mock_v1: List of endpoints for v1 for the freezer API.
        """
        mock_driver.get_db.return_value = None
        mock_v2.endpoints = []

        # Iterate through all of the versions of falcon that should be using
        # the old before=,after= invocation and ensure that freezer-api isn't
        # trying to invoke it in the old style.
        for version_string in self.falcon_versions_hooks:
            version_attribute = '__version__' if hasattr(
                falcon, '__version__') else 'version'
            with patch('falcon.' + version_attribute, version_string):
                # Attempt to invoke a mocked version of falcon to see what args
                # it was called with

                service.freezer_appv2_factory(None)