# Path: invenio_files_rest/ext.py
# class InvenioFilesREST(object):
#     """Invenio-Files-REST extension."""
# 
#     def __init__(self, app=None):
#         """Extension initialization."""
#         if app:
#             self.init_app(app)
# 
#     def init_app(self, app):
#         """Flask application initialization."""
#         self.init_config(app)
#         if hasattr(app, 'cli'):
#             app.cli.add_command(files_cmd)
#         app.extensions['invenio-files-rest'] = _FilesRESTState(app)
# 
#     def init_config(self, app):
#         """Initialize configuration."""
#         for k in dir(config):
#             if k.startswith('FILES_REST_'):
#                 app.config.setdefault(k, getattr(config, k))


import pytest
from flask import Flask, current_app
from invenio_files_rest import InvenioFilesREST
    from invenio_files_rest import __version__
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2019 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

"""Module tests."""




def test_version():
    """Test version import."""
    assert __version__


def test_init():
    """Test extension initialization."""
    app = Flask('testapp')
    ext = InvenioFilesREST(app)
    assert 'invenio-files-rest' in app.extensions

    app = Flask('testapp')

# Path: invenio_files_rest/ext.py
# class InvenioFilesREST(object):
#     """Invenio-Files-REST extension."""
# 
#     def __init__(self, app=None):
#         """Extension initialization."""
#         if app:
#             self.init_app(app)
# 
#     def init_app(self, app):
#         """Flask application initialization."""
#         self.init_config(app)
#         if hasattr(app, 'cli'):
#             app.cli.add_command(files_cmd)
#         app.extensions['invenio-files-rest'] = _FilesRESTState(app)
# 
#     def init_config(self, app):
#         """Initialize configuration."""
#         for k in dir(config):
#             if k.startswith('FILES_REST_'):
#                 app.config.setdefault(k, getattr(config, k))


# Path: tests/test_invenio_files_rest.py
import pytest
from flask import Flask, current_app
from invenio_files_rest import InvenioFilesREST
    from invenio_files_rest import __version__

# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2019 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

"""Module tests."""




def test_version():
    """Test version import."""
    assert __version__


def test_init():
    """Test extension initialization."""
    app = Flask('testapp')
    ext = InvenioFilesREST(app)
    assert 'invenio-files-rest' in app.extensions

    app = Flask('testapp')

    ext = InvenioFilesREST()