Ejemplo n.º 1
0
def test_existing_root_route(tapp):
    tapp.router.add_path('/testing/v2', setup_test_objects.TestHomeResource())
    getenv = setup_test_objects.EnvInput('GET', '/testing/v2')
    assert tapp(getenv.env, start_response) == 'this is hard coded home'
Ejemplo n.º 2
0
def app_add_hard_route(tapp):
    tapp.add_hard_coded_path('/home', setup_test_objects.TestHomeResource())
Ejemplo n.º 3
0
def test_crouter_add_varchild(tcrouter):
    tcrouter.add_path('/rootnode/{var1}',setup_test_objects.TestHomeResource())
    assert type(tcrouter.root_node_dict['rootnode'].varchild) == pylw.routing.Node
Ejemplo n.º 4
0
def test_cadd_route_no_leading_slash(tcrouter):
    tcrouter.add_path('rootnode/somechild/child2',setup_test_objects.TestHomeResource())
Ejemplo n.º 5
0
def test_router_add_path(trouter):
    trouter.add_path('/rootnode',setup_test_objects.TestHomeResource())
    assert type(trouter.root_node_dict['rootnode']) == pylw.routing.Node