fix: allow config injection for sake of tests
now that wuttaweb sort of expects a db connection on startup
This commit is contained in:
parent
36ec626c7f
commit
cc31592580
3 changed files with 9 additions and 9 deletions
|
@ -32,7 +32,7 @@ classifiers = [
|
|||
license = {text = "GNU General Public License v3+"}
|
||||
requires-python = ">= 3.8"
|
||||
dependencies = [
|
||||
"WuttaWeb>=0.21.5",
|
||||
"WuttaWeb>=0.22.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
|
|
|
@ -47,15 +47,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.
|
||||
"""
|
||||
return base.make_asgi_app(main)
|
||||
return base.make_asgi_app(main, config=config)
|
||||
|
|
|
@ -17,15 +17,15 @@ class TestMain(DataTestCase):
|
|||
self.assertIsInstance(app, Router)
|
||||
|
||||
|
||||
class TestMakeWsgiApp(TestCase):
|
||||
class TestMakeWsgiApp(DataTestCase):
|
||||
|
||||
def test_coverage(self):
|
||||
app = mod.make_wsgi_app()
|
||||
app = mod.make_wsgi_app(config=self.config)
|
||||
self.assertIsInstance(app, Router)
|
||||
|
||||
|
||||
class TestMakeAsgiApp(TestCase):
|
||||
class TestMakeAsgiApp(DataTestCase):
|
||||
|
||||
def test_coverage(self):
|
||||
app = mod.make_asgi_app()
|
||||
app = mod.make_asgi_app(config=self.config)
|
||||
self.assertIsInstance(app, WsgiToAsgi)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue