fix: allow config injection for sake of tests
per changes in wuttaweb, sideshow
This commit is contained in:
parent
198c3f77bb
commit
bad6ded72d
4 changed files with 45 additions and 14 deletions
|
@ -44,7 +44,8 @@ def main(global_config, **settings):
|
|||
pyramid_config = base.make_pyramid_config(settings)
|
||||
|
||||
# configure DB sessions
|
||||
CoreOpSession.configure(bind=wutta_config.core_office_op_engine)
|
||||
if hasattr(wutta_config, 'core_office_op_engine'):
|
||||
CoreOpSession.configure(bind=wutta_config.core_office_op_engine)
|
||||
|
||||
# bring in the rest of Sideshow
|
||||
pyramid_config.include('sideshow.web')
|
||||
|
@ -53,15 +54,15 @@ def main(global_config, **settings):
|
|||
return pyramid_config.make_wsgi_app()
|
||||
|
||||
|
||||
def make_wsgi_app():
|
||||
def make_wsgi_app(config=None):
|
||||
"""
|
||||
Make and return the WSGI app (generic entry point).
|
||||
"""
|
||||
return base.make_wsgi_app(main)
|
||||
return base.make_wsgi_app(main, config=config)
|
||||
|
||||
|
||||
def make_asgi_app():
|
||||
def make_asgi_app(config=None):
|
||||
"""
|
||||
Make and return the ASGI app (generic entry point).
|
||||
"""
|
||||
return base.make_asgi_app(main)
|
||||
return base.make_asgi_app(main, config=config)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue