Beispiel #1
0
def test_without_percolator(app, request):
    """Test percolator."""
    with app.test_request_context():
        current_oaiserver.unregister_signals()
        current_oaiserver.register_signals()

        _try_populate_oaisets()
def test_without_percolator(app, request):
    """Test percolator."""
    with app.test_request_context():
        current_oaiserver.unregister_signals()
        current_oaiserver.register_signals()

        _try_populate_oaisets()
def with_record_signals(app):
    """Enable the record insert/update signals for OAISets."""
    current_oaiserver.register_signals()
    prev_cache = current_oaiserver.cache
    current_oaiserver.cache = SimpleCache()
    yield
    current_oaiserver.cache = prev_cache
    current_oaiserver.unregister_signals()
def test_init():
    """Test extension initialization."""
    app = Flask('testapp')
    ext = InvenioOAIServer(app)
    assert 'invenio-oaiserver' in app.extensions

    app = Flask('testapp')
    ext = InvenioOAIServer()
    assert 'invenio-oaiserver' not in app.extensions
    ext.init_app(app)
    assert 'invenio-oaiserver' in app.extensions
    with app.app_context():
        current_oaiserver.unregister_signals()
def test_init():
    """Test extension initialization."""
    app = Flask('testapp')
    ext = InvenioOAIServer(app)
    assert 'invenio-oaiserver' in app.extensions

    app = Flask('testapp')
    ext = InvenioOAIServer()
    assert 'invenio-oaiserver' not in app.extensions
    ext.init_app(app)
    assert 'invenio-oaiserver' in app.extensions
    with app.app_context():
        current_oaiserver.unregister_signals()