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

All Samples(29)  |  Call(23)  |  Derive(0)  |  Import(6)

src/t/g/tg2-HEAD/tests/test_controllers.py   tg2(Download)
from tg.exceptions import HTTPFound
from nose.tools import eq_
from tests.base import TestWSGIController, make_app, setup_session_dir, teardown_session_dir, create_request
from tg.util import no_warn
from tg._compat import u_, string_type
def test_create_request():
    environ = { 'SCRIPT_NAME' : '/xxx' }
    request = create_request('/', environ)
    eq_('http://localhost/xxx/hello', tg.request.relative_url('hello'))
    eq_('http://localhost/xxx', tg.request.application_url)
 
def test_approots():
    create_request('/subthing/',{ 'SCRIPT_NAME' : '/subthing' })
def test_lowerapproots():
    create_request(
                '/subthing/subsubthing/',
                { 'SCRIPT_NAME' : '/subthing/subsubthing' }
                )
    eq_("/subthing/subsubthing/foo", url("/foo"))
 
@no_warn
def test_multi_values():
    create_request('/')

src/t/u/TurboGears2-2.3.2/tests/test_controllers.py   TurboGears2(Download)
from tg.exceptions import HTTPFound
from nose.tools import eq_
from tests.base import TestWSGIController, make_app, setup_session_dir, teardown_session_dir, create_request
from tg.util import no_warn
from tg._compat import u_, string_type
def test_create_request():
    environ = { 'SCRIPT_NAME' : '/xxx' }
    request = create_request('/', environ)
    eq_('http://localhost/xxx/hello', tg.request.relative_url('hello'))
    eq_('http://localhost/xxx', tg.request.application_url)
 
def test_approots():
    create_request('/subthing/',{ 'SCRIPT_NAME' : '/subthing' })
def test_lowerapproots():
    create_request(
                '/subthing/subsubthing/',
                { 'SCRIPT_NAME' : '/subthing/subsubthing' }
                )
    eq_("/subthing/subsubthing/foo", url("/foo"))
 
@no_warn
def test_multi_values():
    create_request('/')

src/t/g/tg2-HEAD/tests/test_render.py   tg2(Download)
import tg
from tg.render import MissingRendererError
from tests.base import TestWSGIController, make_app, setup_session_dir, teardown_session_dir, create_request
 
from tg.configuration import AppConfig

src/t/g/tg2-HEAD/tests/test_configuration.py   tg2(Download)
import tg.i18n
from tg import TGController, expose, response, request, abort
from tests.base import TestWSGIController, make_app, setup_session_dir, teardown_session_dir, create_request
from webtest import TestApp
from tg.renderers.base import RendererFactory

src/t/u/TurboGears2-2.3.2/tests/test_render.py   TurboGears2(Download)
import tg
from tg.render import MissingRendererError
from tests.base import TestWSGIController, make_app, setup_session_dir, teardown_session_dir, create_request
 
from tg.configuration import AppConfig

src/t/u/TurboGears2-2.3.2/tests/test_configuration.py   TurboGears2(Download)
import tg.i18n
from tg import TGController, expose, response, request, abort
from tests.base import TestWSGIController, make_app, setup_session_dir, teardown_session_dir, create_request
from webtest import TestApp
from tg.renderers.base import RendererFactory