Exemplo n.º 1
0
def ws_ctx(path, app=None):
    builder = ScopeBuilder(path)
    scope_data = builder.get_data()[0]
    scope_data.update(type='websocket', scheme='wss')
    token = current._init_(FakeWSContext, app, scope_data, None, None)
    yield current
    current._close_(token)
Exemplo n.º 2
0
def current_ctx(app, path):
    builder = ScopeBuilder(path)
    token = current._init_(FakeRequestContext, app, builder.get_data()[0])
    yield current
    current._close_(token)
Exemplo n.º 3
0
def ctx():
    builder = ScopeBuilder()
    token = current._init_(FakeRequestContext, None,
                           builder.get_data()[0], None, None)
    yield current
    current._close_(token)