Ejemplo n.º 1
0
def app() -> Generator[Flask, None, None]:
    """Creates a flask test app, with an app context.

    The app can be used to create a test http client as well:
    with app.test_client() as client:
        client.get(...)
    """
    app = get_flask_app()
    with app.app_context():
        yield app
Ejemplo n.º 2
0
def get_app():
    # Start messagedriven_service in separate thread
    t = Thread(target=run_message_thread)
    t.start()

    return get_flask_app()
Ejemplo n.º 3
0
 def test_get_app(self, mock_flask, mock_middleware):
     mock_app = mock.MagicMock()
     mock_flask.return_value = mock_app
     app = get_flask_app()
     mock_middleware.assert_called_with(app)
Ejemplo n.º 4
0
 def test_get_app(self, mock_flask):
     mock_app = mock.MagicMock()
     mock_flask.return_value = mock_app
     app = get_flask_app()
     mock_flask.assert_called()
     mock_app.route.assert_called()