本文整理汇总了Python中pylons.url._push_object函数的典型用法代码示例。如果您正苦于以下问题:Python _push_object函数的具体用法?Python _push_object怎么用?Python _push_object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_push_object函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, *args, **kwargs):
'''
initialize the test class
'''
wsgiapp = pylons.test.pylonsapp
self.app = webtest.TestApp(wsgiapp)
self.session = 'justatest'
url._push_object(URLGenerator(config['routes.map'], environ))
unittest2.TestCase.__init__(self, *args, **kwargs)
self.appconf = config
self.resolvers_params = {
'myDefRes': {
'name' : 'myDefRes',
'fileName' : '%(here)s/../data/testdata/def-passwd',
'type' : 'passwdresolver',
},
'myOtherRes' : {
'name' : 'myOtherRes',
'fileName' : '%(here)s/../data/testdata/myDom-passwd',
'type' : 'passwdresolver',
}
}
self.resolvers = {
'myOtherRes': 'useridresolver.PasswdIdResolver.IdResolver.myOtherRes',
'myDefRes': 'useridresolver.PasswdIdResolver.IdResolver.myDefRes',
}
开发者ID:ukris,项目名称:LinOTP,代码行数:30,代码来源:__init__.py
示例2: __init__
def __init__(self, *args, **kwargs):
if pylons.test.pylonsapp:
wsgiapp = pylons.test.pylonsapp
else:
wsgiapp = loadapp('config:%s' % config['__file__'])
self.app = TestApp(wsgiapp)
url._push_object(URLGenerator(config['routes.map'], environ))
开发者ID:deeban25,项目名称:shakespeare,代码行数:7,代码来源:__init__.py
示例3: __init__
def __init__(self, *args, **kwargs):
wsgiapp = pylons.test.pylonsapp
config = wsgiapp.config
self.app = PatchedTestApp(wsgiapp)
app_globals._push_object(config['pylons.app_globals'])
url._push_object(URLGenerator(config['routes.map'], environ))
TestCase.__init__(self, *args, **kwargs)
开发者ID:yoshrote,项目名称:Columns,代码行数:7,代码来源:__init__.py
示例4: create_request
def create_request(path, environ=None):
"""Helper used in test cases to quickly setup a request obj.
``path``
The path will become PATH_INFO
``environ``
Additional environment
Returns an instance of the `webob.Request` object.
"""
# setup the environ
if environ is None:
environ = {}
environ.update(default_environ)
# create a "blank" WebOb Request object
# using Pylon's Request which is a webob Request plus
# some compatibility methods
req = Request.blank(path, environ)
# setup a Registry
reg = environ.setdefault('paste.registry', Registry())
reg.prepare()
# setup pylons.request to point to our Registry
reg.register(pylons.request, req)
# setup tmpl context
tmpl_context._push_object(ContextObj())
url._push_object(URLGenerator(default_map, environ))
return req
开发者ID:chiehwen,项目名称:tg2,代码行数:30,代码来源:base.py
示例5: __init__
def __init__(self, *args, **kwargs):
'''
initialize the test class
'''
TestCase.__init__(self, *args, **kwargs)
LOG.error("ConfigFile: %s " % config['__file__'])
conffile = config['__file__']
if pylons.test.pylonsapp:
wsgiapp = pylons.test.pylonsapp
else:
wsgiapp = loadapp('config: %s' % config['__file__'])
self.app = TestApp(wsgiapp)
conf = None
if conffile.startswith('/'):
conf = appconfig('config:%s' % config['__file__'], relative_to=None)
else:
raise Exception('dont know how to load the application relatively')
#conf = appconfig('config: %s' % config['__file__'], relative_to=rel)
load_environment(conf.global_conf, conf.local_conf)
self.appconf = conf
url._push_object(URLGenerator(config['routes.map'], environ))
self.isSelfTest = False
if env.has_key("privacyidea.selfTest"):
self.isSelfTest = True
self.license = 'CE'
return
开发者ID:itd,项目名称:privacyidea,代码行数:35,代码来源:__init__.py
示例6: __init__
def __init__(self, *args, **kwargs):
""" TestController init """
wsgiapp = pylons.test.pylonsapp
config = wsgiapp.config
self.app = TestApp(wsgiapp)
url._push_object(URLGenerator(config['routes.map'], environ))
TestCase.__init__(self, *args, **kwargs)
开发者ID:anzarafaq,项目名称:cronusagent,代码行数:7,代码来源:__init__.py
示例7: __init__
def __init__(self, *args, **kwargs):
wsgiapp = pylons.test.pylonsapp
config = wsgiapp.config
self.app = webtest.TestApp(wsgiapp)
url._push_object(URLGenerator(config['routes.map'], environ))
self.__setattrs__()
self.__setcreateparams__()
TestCase.__init__(self, *args, **kwargs)
开发者ID:FieldDB,项目名称:old,代码行数:8,代码来源:__init__.py
示例8: __init__
def __init__(self, *args, **kwargs):
import sys
self.wsgiapp = pylons.test.pylonsapp
self.config = self.wsgiapp.config
self.app = fixture.TestApp(self.wsgiapp)
url._push_object(URLGenerator(self.config['routes.map'], environ))
TestRollback.__init__(self, *args, **kwargs)
开发者ID:benogle,项目名称:vanillons,代码行数:8,代码来源:__init__.py
示例9: __init__
def __init__(self, *args, **kwargs):
wsgiapp = pylons.test.pylonsapp
config = wsgiapp.config
self.app = OptionsTestApp(wsgiapp)
url._push_object(URLGenerator(config['routes.map'], environ))
TestCase.__init__(self, *args, **kwargs)
self.from_date = datetime(1990,1,1).isoformat() + "Z"
self.controllerName = None
开发者ID:wegrata,项目名称:LearningRegistry,代码行数:8,代码来源:__init__.py
示例10: __init__
def __init__(self, *args, **kwargs):
wsgiapp = pylons.test.pylonsapp
config = wsgiapp.application.config
self.config = config
self.app = TestApp(wsgiapp)
self.g = self.config['pylons.app_globals']
url._push_object(URLGenerator(config['routes.map'], environ))
TestCase.__init__(self, *args, **kwargs)
开发者ID:hwine,项目名称:build-buildapi,代码行数:8,代码来源:__init__.py
示例11: __init__
def __init__(self, *args, **kwargs):
wsgiapp = pylons.test.pylonsapp
config = wsgiapp.config
self.app = TestApp(wsgiapp)
url._push_object(URLGenerator(config['routes.map'], environ))
TestCase.__init__(self, *args, **kwargs)
self.pkey, self.cert = _generate_mock_cert()
开发者ID:andrea-manzi,项目名称:fts3-rest,代码行数:8,代码来源:__init__.py
示例12: __init__
def __init__(self, *args, **kwargs):
self.authz_file = os.path.dirname(__file__) + '/../../config/svn.access.test'
wsgiapp = pylons.test.pylonsapp
config = wsgiapp.config
self.app = TestApp(wsgiapp)
url._push_object(URLGenerator(config['routes.map'], environ))
TestCase.__init__(self, *args, **kwargs)
开发者ID:jiangxin,项目名称:pySvnManager,代码行数:8,代码来源:__init__.py
示例13: __init__
def __init__(self, *args, **kwargs):
wsgiapp = pylons.test.pylonsapp
config = wsgiapp.config
self.app = TestApp(wsgiapp)
url._push_object(URLGenerator(config['routes.map'], environ))
self.Session = Session
self.index_location = config['app_conf']['index_dir']
TestCase.__init__(self, *args, **kwargs)
开发者ID:break123,项目名称:rhodecode,代码行数:9,代码来源:__init__.py
示例14: __init__
def __init__(self, *args, **kwargs):
#~ if pylons.test.pylonsapp:
#~ wsgiapp = pylons.test.pylonsapp
#~ else:
#~ wsgiapp = loadapp('config:%s' % config['__file__'])
wsgiapp = pylons.test.pylonsapp
self.config = wsgiapp.config
self.app = TestApp(wsgiapp)
url._push_object(URLGenerator(self.config['routes.map'], environ))
TestCase.__init__(self, *args, **kwargs)
开发者ID:arturh85,项目名称:truthmaschine,代码行数:10,代码来源:__init__.py
示例15: __init__
def __init__(self, *args, **kwargs):
wsgiapp = pylons.test.pylonsapp
config = wsgiapp.config
self.app = TestApp(wsgiapp)
url._push_object(URLGenerator(config['routes.map'], environ))
# should perhaps be in setup
pylons.app_globals._push_object(Globals(config))
# pylons.app_globals._pop_object() # should perhaps be in teardown
super(TestControllerBase, self).__init__(*args, **kwargs)
开发者ID:dwt,项目名称:adhocracy,代码行数:10,代码来源:__init__.py
示例16: init_stack
def init_stack(config=None):
if not config:
config = pylons.test.pylonsapp.config
url._push_object(URLGenerator(config['routes.map'], environ))
pylons.app_globals._push_object(config['pylons.app_globals'])
pylons.config._push_object(config)
pylons.tmpl_context._push_object(ContextObj())
# Initialize a translator for tests that utilize i18n
translator = _get_translator(pylons.config.get('lang'))
pylons.translator._push_object(translator)
开发者ID:adamscieszko,项目名称:rhodecode,代码行数:10,代码来源:__init__.py
示例17: __init__
def __init__(self, *args, **kwargs):
if pylons.test.pylonsapp:
wsgiapp = pylons.test.pylonsapp
else:
wsgiapp = loadapp('config:%s' % config['__file__'])
self.app = TestApp(wsgiapp)
url._push_object(URLGenerator(config['routes.map'], environ))
# should perhaps be in setup
pylons.app_globals._push_object(Globals())
# pylons.app_globals._pop_object() # should perhaps be in teardown
super(TestControllerBase, self).__init__(*args, **kwargs)
开发者ID:JonnyWalker,项目名称:adhocracy,代码行数:12,代码来源:__init__.py
示例18: __init__
def __init__(self, *args, **kwargs):
wsgiapp = pylons.test.pylonsapp
config = wsgiapp.config
self.app = OptionsTestApp(wsgiapp)
url._push_object(URLGenerator(config['routes.map'], environ))
TestCase.__init__(self, *args, **kwargs)
self.from_date = datetime(1990,1,1).isoformat() + "Z"
self.controllerName = None
def get_wsgiapp():
return wsgiapp
wsgi_intercept.add_wsgi_intercept('localhost', 80, get_wsgiapp)
wsgi_intercept.add_wsgi_intercept('127.0.0.1', 80, get_wsgiapp)
开发者ID:LearningRegistry,项目名称:LearningRegistry,代码行数:12,代码来源:__init__.py
示例19: __init__
def __init__(self, *args, **kwargs):
wsgiapp = loadapp('config:test.ini', relative_to=conf_dir)
config = wsgiapp.config
pylons.app_globals._push_object(config['pylons.app_globals'])
pylons.config._push_object(config)
# Initialize a translator for tests that utilize i18n
translator = _get_translator(pylons.config.get('lang'))
pylons.translator._push_object(translator)
url._push_object(URLGenerator(config['routes.map'], environ))
self.app = TestApp(wsgiapp)
TestCase.__init__(self, *args, **kwargs)
开发者ID:NERC-CEH,项目名称:jules-jasmin,代码行数:13,代码来源:__init__.py
示例20: __init__
def __init__(self, *args, **kwargs):
wsgiapp = pylons.test.pylonsapp
config = wsgiapp.config
self.app = TestApp(wsgiapp)
url._push_object(URLGenerator(config['routes.map'], environ))
response = self.app.get(url(controller='users', action='login'))
form = response.form
form['login'] = 'admin'
form['password'] = 'r1a9f8a3l'
response = form.submit()
TestCase.__init__(self, *args, **kwargs)
开发者ID:rafal-kos,项目名称:pytis,代码行数:14,代码来源:__init__.py
注:本文中的pylons.url._push_object函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论