# Path: amivapi/tests/utils.py
# class WebTestNoAuth(WebTest):
#     """WebTest without authentification."""
# 
#     def setUp(self, **extra_config):
#         """Use auth hook to always authenticate as root for every request."""
#         super().setUp(**extra_config)
# 
#         def authenticate_root(resource):
#             g.resource_admin = True
# 
#         self.app.after_auth += authenticate_root


from io import BytesIO
from os.path import dirname, join
from werkzeug.datastructures import FileStorage
from amivapi.tests.utils import WebTestNoAuth
# -*- coding: utf-8 -*-
#
# license: AGPLv3, see LICENSE for details. In addition we strongly encourage
#          you to buy us beer if we meet and you like the software.

"""Test Media handling."""



lenaname = "lena.png"
lenapath = join(dirname(__file__), "fixtures", lenaname)
with open(lenapath, 'rb') as f:
    lenadata = f.read()

test_resource = {
    'resource_methods': ['POST', 'GET'],
    'item_methods': ['GET', 'DELETE'],
    'schema': {
        'test_file': {
            'type': 'media'
        }
    }
}



# Path: amivapi/tests/utils.py
# class WebTestNoAuth(WebTest):
#     """WebTest without authentification."""
# 
#     def setUp(self, **extra_config):
#         """Use auth hook to always authenticate as root for every request."""
#         super().setUp(**extra_config)
# 
#         def authenticate_root(resource):
#             g.resource_admin = True
# 
#         self.app.after_auth += authenticate_root


# Path: amivapi/tests/test_media.py
from io import BytesIO
from os.path import dirname, join
from werkzeug.datastructures import FileStorage
from amivapi.tests.utils import WebTestNoAuth

# -*- coding: utf-8 -*-
#
# license: AGPLv3, see LICENSE for details. In addition we strongly encourage
#          you to buy us beer if we meet and you like the software.

"""Test Media handling."""



lenaname = "lena.png"
lenapath = join(dirname(__file__), "fixtures", lenaname)
with open(lenapath, 'rb') as f:
    lenadata = f.read()

test_resource = {
    'resource_methods': ['POST', 'GET'],
    'item_methods': ['GET', 'DELETE'],
    'schema': {
        'test_file': {
            'type': 'media'
        }
    }
}



class MediaTest(WebTestNoAuth):