Beispiel #1
0
def create_app(settings_override=None):
    """Return the NYC Python frontend application.

    :param settings_override: a ``dict`` of settings to override.

    """
    app = factory.create_app(__name__, __path__, settings_override)

    if not app.debug:
        for e in (404, 500):
            app.errorhandler(e)(handle_error)

    return _easteregg(app)
Beispiel #2
0
 def test_easteregg(self):
     req = Request.from_values('/?macgybarchakku')
     resp = Response.force_type(internal._easteregg(None), req)
     assert b'About Werkzeug' in resp.get_data()
     assert b'the Swiss Army knife of Python web development' in resp.get_data()
Beispiel #3
0
 def test_easteregg(self):
     req = Request.from_values('/?macgybarchakku')
     resp = Response.force_type(internal._easteregg(None), req)
     assert b'About Werkzeug' in resp.get_data()
     assert b'the Swiss Army knife of Python web development' in resp.get_data(
     )
Beispiel #4
0
def test_easteregg():
    """Make sure the easteregg runs"""
    req = Request.from_values('/?macgybarchakku')
    resp = Response.force_type(internal._easteregg(None), req)
    assert 'About Werkzeug' in resp.data
    assert 'the Swiss Army knife of Python web development' in resp.data