Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(23)  |  Call(14)  |  Derive(0)  |  Import(9)

src/c/l/clastic-0.3.0/clastic/tests/test_middleware.py   clastic(Download)
from clastic import Application
from clastic.middleware import Middleware, GetParamMiddleware
from common import hello_world, hello_world_ctx, RequestProvidesName
 
 
def test_blank_req_provides():
    req_provides_blank = RequestProvidesName()
    app = Application([('/', hello_world)],
                      middlewares=[req_provides_blank])
    c = Client(app, BaseResponse)
def test_req_provides():
    req_provides = RequestProvidesName('Rajkumar')
    app = Application([('/', hello_world)],
                      middlewares=[req_provides])
    c = Client(app, BaseResponse)

src/c/l/clastic-HEAD/clastic/tests/test_middleware.py   clastic(Download)
from clastic import Application
from clastic.middleware import Middleware, GetParamMiddleware
from common import hello_world, hello_world_ctx, RequestProvidesName
 
 
def test_blank_req_provides():
    req_provides_blank = RequestProvidesName()
    app = Application([('/', hello_world)],
                      middlewares=[req_provides_blank])
    c = Client(app, BaseResponse)
def test_req_provides():
    req_provides = RequestProvidesName('Rajkumar')
    app = Application([('/', hello_world)],
                      middlewares=[req_provides])
    c = Client(app, BaseResponse)

src/c/l/clastic-0.3.0/clastic/tests/test_basic.py   clastic(Download)
from clastic import Application
 
from common import hello_world, DummyMiddleware, RequestProvidesName
 
 
def test_duplicate_arg_mw():
    req_provides1 = RequestProvidesName('Rajkumar')
    req_provides2 = RequestProvidesName('Jimmy John')
    Application([('/', hello_world)],
                middlewares=[req_provides1,

src/c/l/clastic-HEAD/clastic/tests/test_basic.py   clastic(Download)
from clastic.application import Application
 
from common import hello_world, DummyMiddleware, RequestProvidesName
 
 
def test_duplicate_arg_mw():
    req_provides1 = RequestProvidesName('Rajkumar')
    req_provides2 = RequestProvidesName('Jimmy John')
    Application([('/', hello_world)],
                middlewares=[req_provides1,

src/c/l/clastic-HEAD/clastic/tests/test_decorators.py   clastic(Download)
 
from clastic import Application
from common import hello_world, RequestProvidesName
from clastic.decorators import clastic_decorator
 
def test_cl_decorated():
    req_provides_blank = RequestProvidesName()
    app = Application([('/', hello_world_ok)],
                      middlewares=[req_provides_blank])
    c = Client(app, BaseResponse)
def test_broken_decorated():
    req_provides_blank = RequestProvidesName()
    app = Application([('/', hello_world_no)],
                      middlewares=[req_provides_blank])
    c = Client(app, BaseResponse)

src/c/l/clastic-HEAD/clastic/tests/test_context_proc.py   clastic(Download)
from clastic import Application, render_json, render_basic
from clastic.middleware import SimpleContextProcessor, ContextProcessor
from common import (hello_world,
                    hello_world_str,
                    hello_world_ctx,
def test_ctx_proc_req():
    req_provides_name = RequestProvidesName()
    add_name_lang = ContextProcessor(['name'], {'language': 'en'})
    app = Application([('/', hello_world_ctx, render_json)],
                      middlewares=[req_provides_name, add_name_lang])

src/c/l/clastic-0.3.0/clastic/tests/test_exceptions.py   clastic(Download)
 
from clastic import Application
from common import hello_world, RequestProvidesName
from clastic.errors import (make_error_handler_map,
                            BadGateway,

src/c/l/clastic-0.3.0/clastic/tests/test_decorators.py   clastic(Download)
 
from clastic import Application
from common import hello_world, RequestProvidesName
from clastic.decorators import clastic_decorator
 
def test_cl_decorated():
    req_provides_blank = RequestProvidesName()
    app = Application([('/', hello_world_ok)],
                      middlewares=[req_provides_blank])
    c = Client(app, BaseResponse)
def test_broken_decorated():
    req_provides_blank = RequestProvidesName()
    app = Application([('/', hello_world_no)],
                      middlewares=[req_provides_blank])
    c = Client(app, BaseResponse)

src/c/l/clastic-0.3.0/clastic/tests/test_context_proc.py   clastic(Download)
from clastic import Application, render_json, render_basic
from clastic.middleware import SimpleContextProcessor, ContextProcessor
from common import (hello_world,
                    hello_world_str,
                    hello_world_ctx,
def test_ctx_proc_req():
    req_provides_name = RequestProvidesName()
    add_name_lang = ContextProcessor(['name'], {'language': 'en'})
    app = Application([('/', hello_world_ctx, render_json)],
                      middlewares=[req_provides_name, add_name_lang])