mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-25 02:53:56 +03:00
Update sanic example
This commit is contained in:
parent
b8c23a204d
commit
dc6311d2e2
|
@ -98,8 +98,8 @@ The output should be something like:
|
||||||
|
|
||||||
.. code-block::
|
.. code-block::
|
||||||
|
|
||||||
platform darwin -- Python 3.9, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
|
platform darwin -- Python 3.10.0, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
|
||||||
plugins: cov-2.12.1, sanic-1.8.1, anyio-3.3.2
|
plugins: sanic-1.9.1, anyio-3.3.4, cov-3.0.0
|
||||||
collected 3 items
|
collected 3 items
|
||||||
|
|
||||||
giphynavigator/tests.py ... [100%]
|
giphynavigator/tests.py ... [100%]
|
||||||
|
@ -109,11 +109,11 @@ The output should be something like:
|
||||||
---------------------------------------------------
|
---------------------------------------------------
|
||||||
giphynavigator/__init__.py 0 0 100%
|
giphynavigator/__init__.py 0 0 100%
|
||||||
giphynavigator/__main__.py 4 4 0%
|
giphynavigator/__main__.py 4 4 0%
|
||||||
giphynavigator/application.py 12 0 100%
|
giphynavigator/application.py 11 0 100%
|
||||||
giphynavigator/containers.py 6 0 100%
|
giphynavigator/containers.py 6 0 100%
|
||||||
giphynavigator/giphy.py 14 9 36%
|
giphynavigator/giphy.py 14 9 36%
|
||||||
giphynavigator/handlers.py 11 0 100%
|
giphynavigator/handlers.py 11 0 100%
|
||||||
giphynavigator/services.py 9 1 89%
|
giphynavigator/services.py 9 1 89%
|
||||||
giphynavigator/tests.py 39 0 100%
|
giphynavigator/tests.py 39 0 100%
|
||||||
---------------------------------------------------
|
---------------------------------------------------
|
||||||
TOTAL 95 14 85%
|
TOTAL 94 14 85%
|
||||||
|
|
|
@ -9,7 +9,6 @@ from . import handlers
|
||||||
def create_app() -> Sanic:
|
def create_app() -> Sanic:
|
||||||
"""Create and return Sanic application."""
|
"""Create and return Sanic application."""
|
||||||
container = Container()
|
container = Container()
|
||||||
container.config.from_yaml("config.yml")
|
|
||||||
container.config.giphy.api_key.from_env("GIPHY_API_KEY")
|
container.config.giphy.api_key.from_env("GIPHY_API_KEY")
|
||||||
container.wire(modules=[handlers])
|
container.wire(modules=[handlers])
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ from . import giphy, services
|
||||||
|
|
||||||
class Container(containers.DeclarativeContainer):
|
class Container(containers.DeclarativeContainer):
|
||||||
|
|
||||||
config = providers.Configuration()
|
config = providers.Configuration(yaml_files=["config.yml"])
|
||||||
|
|
||||||
giphy_client = providers.Factory(
|
giphy_client = providers.Factory(
|
||||||
giphy.GiphyClient,
|
giphy.GiphyClient,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
dependency-injector
|
dependency-injector
|
||||||
sanic
|
sanic<=21.6
|
||||||
aiohttp
|
aiohttp
|
||||||
pyyaml
|
pyyaml
|
||||||
pytest-sanic
|
pytest-sanic
|
||||||
|
|
Loading…
Reference in New Issue
Block a user