# Path: oioswift/common/middleware/crypto/encrypter.py
# class Encrypter(OrigEncrypter):
#     def __call__(self, env, start_response):


import os
import sys
from swift.common.swob import HTTPBadRequest, HTTPCreated, Request
from swift.common.middleware.crypto.crypto_utils import CRYPTO_KEY_CALLBACK
from oioswift.common.middleware.crypto import encrypter
from test.unit import FakeLogger  # noqa
from test.unit.common.middleware.helpers import FakeSwift  # noqa
from test.unit.common.middleware.crypto.test_encrypter import \
    TestEncrypter as OrigTestEncrypter  # noqa
# Copyright (c) 2015-2016 OpenStack Foundation
# Copyright (c) 2018 OpenIO SAS
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.




# Hack PYTHONPATH so "test" is swift's test directory
sys.path.insert(1, os.path.abspath(os.path.join(__file__,
                                                '../../../../../..')))


class TestEncrypter(OrigTestEncrypter):
    def setUp(self):
        self.app = FakeSwift()

# Path: oioswift/common/middleware/crypto/encrypter.py
# class Encrypter(OrigEncrypter):
#     def __call__(self, env, start_response):


# Path: tests/unit/common/middleware/crypto/test_encrypter.py
import os
import sys
from swift.common.swob import HTTPBadRequest, HTTPCreated, Request
from swift.common.middleware.crypto.crypto_utils import CRYPTO_KEY_CALLBACK
from oioswift.common.middleware.crypto import encrypter
from test.unit import FakeLogger  # noqa
from test.unit.common.middleware.helpers import FakeSwift  # noqa
from test.unit.common.middleware.crypto.test_encrypter import \
    TestEncrypter as OrigTestEncrypter  # noqa

# Copyright (c) 2015-2016 OpenStack Foundation
# Copyright (c) 2018 OpenIO SAS
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.




# Hack PYTHONPATH so "test" is swift's test directory
sys.path.insert(1, os.path.abspath(os.path.join(__file__,
                                                '../../../../../..')))


class TestEncrypter(OrigTestEncrypter):
    def setUp(self):
        self.app = FakeSwift()

        self.encrypter = encrypter.Encrypter(self.app, {})