# Path: tests/utils.py
# class HandlerTestCase(testing.AsyncHTTPTestCase):
# 
#     def setUp(self):
#         super().setUp()
#         # identity_future = asyncio.Future()
#         # identity_future.set_result({
#         #     'auth': {},
#         #     'credentials': {},
#         #     'settings': {},
#         # })
#         # self.mock_identity = mock.Mock()
#         # self.mock_identity.return_value = identity_future
#         # self.identity_patcher = mock.patch('waterbutler.server.handlers.core.auth_handler.fetch', self.mock_identity)
# 
#         # self.mock_provider = MockProvider1({}, {}, {})
#         # self.mock_make_provider = mock.Mock(return_value=self.mock_provider)
#         # self.make_provider_patcher = mock.patch('waterbutler.core.utils.make_provider', self.mock_make_provider)
# 
#         # self.identity_patcher.start()
#         # self.make_provider_patcher.start()
# 
#     def tearDown(self):
#         super().tearDown()
#         # self.identity_patcher.stop()
#         # self.make_provider_patcher.stop()
# 
#     def get_app(self):
#         return make_app(debug=False)
# 
#     def get_new_ioloop(self):
#         return AsyncIOMainLoop()


import pytest
from unittest import mock
from tornado import testing
from tests.utils import HandlerTestCase
from mfr.server.handlers.core import CorsMixin




class MockHandler(CorsMixin):

    request = None
    headers = {}

    def set_header(self, key, value):
        self.headers[key] = value

class MockRequest(object):

    def __init__(
            self,
            method='GET',
            cookies=False,
            headers={}
    ):
        self.method = method
        self.cookies = cookies
        self.headers = headers


@mock.patch('mfr.server.settings.CORS_ALLOW_ORIGIN', '')

# Path: tests/utils.py
# class HandlerTestCase(testing.AsyncHTTPTestCase):
# 
#     def setUp(self):
#         super().setUp()
#         # identity_future = asyncio.Future()
#         # identity_future.set_result({
#         #     'auth': {},
#         #     'credentials': {},
#         #     'settings': {},
#         # })
#         # self.mock_identity = mock.Mock()
#         # self.mock_identity.return_value = identity_future
#         # self.identity_patcher = mock.patch('waterbutler.server.handlers.core.auth_handler.fetch', self.mock_identity)
# 
#         # self.mock_provider = MockProvider1({}, {}, {})
#         # self.mock_make_provider = mock.Mock(return_value=self.mock_provider)
#         # self.make_provider_patcher = mock.patch('waterbutler.core.utils.make_provider', self.mock_make_provider)
# 
#         # self.identity_patcher.start()
#         # self.make_provider_patcher.start()
# 
#     def tearDown(self):
#         super().tearDown()
#         # self.identity_patcher.stop()
#         # self.make_provider_patcher.stop()
# 
#     def get_app(self):
#         return make_app(debug=False)
# 
#     def get_new_ioloop(self):
#         return AsyncIOMainLoop()


# Path: tests/server/handlers/test_cors.py
import pytest
from unittest import mock
from tornado import testing
from tests.utils import HandlerTestCase
from mfr.server.handlers.core import CorsMixin





class MockHandler(CorsMixin):

    request = None
    headers = {}

    def set_header(self, key, value):
        self.headers[key] = value

class MockRequest(object):

    def __init__(
            self,
            method='GET',
            cookies=False,
            headers={}
    ):
        self.method = method
        self.cookies = cookies
        self.headers = headers


@mock.patch('mfr.server.settings.CORS_ALLOW_ORIGIN', '')

class TestCorsMixin(HandlerTestCase):