Exemplo n.º 1
0
def app():
    """Flask application fixture."""
    app = Flask('testapp')
    app.config.update(TESTING=True)
    beardserver(app)

    return app
def test_view(app):
    """Test view."""
    Babel(app)
    beardserver(app)
    with app.test_client() as client:
        res = client.get("/")
        assert res.status_code == 200
        assert 'Welcome to beard-server' in str(res.data)
Exemplo n.º 3
0
def app():
    """Flask application fixture."""
    app = Flask('testapp')
    app.config.update(
        TESTING=True
    )
    beardserver(app)

    return app
Exemplo n.º 4
0
def test_init():
    """Test extension initialization."""
    app = Flask('testapp')
    ext = beardserver(app)
    assert 'beard-server' in app.extensions

    app = Flask('testapp')
    ext = beardserver()
    assert 'beard-server' not in app.extensions
    ext.init_app(app)
    assert 'beard-server' in app.extensions
Exemplo n.º 5
0
def test_init():
    """Test extension initialization."""
    app = Flask('testapp')
    ext = beardserver(app)
    assert 'beard-server' in app.extensions

    app = Flask('testapp')
    ext = beardserver()
    assert 'beard-server' not in app.extensions
    ext.init_app(app)
    assert 'beard-server' in app.extensions
Exemplo n.º 6
0
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Inspire; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.

from __future__ import absolute_import, division, print_function, \
    unicode_literals

import logging
import sys

from flask import Flask

from beard_server import beardserver

application = Flask(__name__)
beardserver(application)

logging.basicConfig(stream=sys.stderr)

if __name__ == '__main__':
    application.run(host="0.0.0.0", port=5000, debug=True)
Exemplo n.º 7
0
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.


"""Minimal Flask application example for development.

Run example development server:

.. code-block:: console

   $ cd examples
   $ python app.py
"""

from __future__ import absolute_import, print_function

from flask import Flask
from flask_babelex import Babel

from beard_server import beardserver

# Create Flask application
app = Flask(__name__)
Babel(app)
beardserver(app)

if __name__ == "__main__":
    app.debug = True
    app.run(host='0.0.0.0')
Exemplo n.º 8
0
# You should have received a copy of the GNU General Public License
# along with Inspire; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.
"""Minimal Flask application example for development.

Run example development server:

.. code-block:: console

   $ cd examples
   $ flask -a app.py --debug run
"""

from __future__ import absolute_import, division, print_function, \
    unicode_literals

from flask import Flask
from flask_babelex import Babel

from beard_server import beardserver

# Create Flask application
app = Flask(__name__)
Babel(app)
beardserver(app)