コード例 #1
0
def before_all(context):
    context.app = beer_app.create_app()
    context.app.config['TESTING'] = True
    # DEBUG == False if testing flask.app.run with selenium 
    # otherwise it make f*** mess !!!
    context.app.config['DEBUG'] = False
    context.baseurl = "http://127.0.0.1:8000/"
    context.browser = selenium.webdriver.Firefox()
コード例 #2
0
def before_all(context):
    context.app = beer_app.create_app()
    context.app.config['TESTING'] = True
    # DEBUG == False if testing flask.app.run with selenium
    # otherwise it make f*** mess !!!
    context.app.config['DEBUG'] = False
    context.baseurl = "http://127.0.0.1:8000/"
    context.browser = selenium.webdriver.Firefox()
コード例 #3
0
ファイル: environment.py プロジェクト: wilas/lab-ci
def before_all(context):
    context.baseurl = "http://127.0.0.1:8000"
    context.app = beer_app.create_app()
    context.app.config["TESTING"] = True
    # fn=(lambda : context.app), it help create the WSGI app object only once,
    # because function passed into wsgi_intercept is called
    # once for each intercepted connection
    # more here: http://ivory.idyll.org/articles/twill-and-wsgi_intercept.html
    wsgi_intercept.add_wsgi_intercept("127.0.0.1", 8000, lambda: context.app)
    context.browser = wsgi_intercept.mechanize_intercept.Browser()
コード例 #4
0
def before_all(context):
    context.baseurl = 'http://127.0.0.1:8000'
    context.app = beer_app.create_app()
    context.app.config['TESTING'] = True
    # fn=(lambda : context.app), it help create the WSGI app object only once, 
    # because function passed into wsgi_intercept is called 
    # once for each intercepted connection
    # more here: http://ivory.idyll.org/articles/twill-and-wsgi_intercept.html
    wsgi_intercept.add_wsgi_intercept('127.0.0.1', 8000, lambda: context.app)
    context.browser = wsgi_intercept.mechanize_intercept.Browser()
コード例 #5
0
ファイル: environment.py プロジェクト: DotNetAge/lab-ci
def before_all(context):
    context.baseurl = 'http://127.0.0.1:8000'
    twill.set_output(StringIO.StringIO())
    twill.commands.clear_cookies()
    context.app = beer_app.create_app()
    context.app.config['TESTING'] = True
    # fn=(lambda : context.app), it help create the WSGI app object only once, 
    # because function passed into wsgi_intercept is called 
    # once for each intercepted connection
    # more here: http://ivory.idyll.org/articles/twill-and-wsgi_intercept.html
    twill.add_wsgi_intercept('127.0.0.1', 8000, lambda : context.app)
    context.browser = twill.get_browser()
コード例 #6
0
ファイル: environment.py プロジェクト: DotNetAge/lab-ci
def before_all(context):
    context.app = beer_app.create_app()
    context.app.config['TESTING'] = True
    context.client = context.app.test_client()
コード例 #7
0
def before_all(context):
    context.app = beer_app.create_app()
    context.app.config['TESTING'] = True
    context.client = context.app.test_client()
コード例 #8
0
ファイル: t_beer.py プロジェクト: DotNetAge/lab-ci
import tornado.wsgi
import tornado.httpserver
import tornado.ioloop

import beer_app

app = beer_app.create_app()

def run(address="127.0.0.1", port=5000):
    application = tornado.wsgi.WSGIContainer(app)
    http_server = tornado.httpserver.HTTPServer(application)
    http_server.listen(port,address)
    tornado.ioloop.IOLoop.instance().start()

if __name__ == "__main__":
    run(address="0.0.0.0", port=8000)