fix: allow config injection for sake of tests

per changes in wuttaweb, sideshow
This commit is contained in:
Lance Edgar 2025-07-06 14:09:11 -05:00
parent 198c3f77bb
commit bad6ded72d
4 changed files with 45 additions and 14 deletions

View file

@ -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)