mirror of
				https://github.com/ets-labs/python-dependency-injector.git
				synced 2025-11-04 01:47:36 +03:00 
			
		
		
		
	Update sanic example
This commit is contained in:
		
							parent
							
								
									7a6ff43b2c
								
							
						
					
					
						commit
						06d865c7b7
					
				| 
						 | 
					@ -112,8 +112,8 @@ The output should be something like:
 | 
				
			||||||
   giphynavigator/application.py      12      0   100%
 | 
					   giphynavigator/application.py      12      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         10      0   100%
 | 
					   giphynavigator/handlers.py         11      0   100%
 | 
				
			||||||
   giphynavigator/services.py          9      1    89%
 | 
					   giphynavigator/services.py          9      1    89%
 | 
				
			||||||
   giphynavigator/tests.py            34      0   100%
 | 
					   giphynavigator/tests.py            34      0   100%
 | 
				
			||||||
   ---------------------------------------------------
 | 
					   ---------------------------------------------------
 | 
				
			||||||
   TOTAL                              89     14    84%
 | 
					   TOTAL                              90     14    84%
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,12 +2,13 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from sanic.request import Request
 | 
					from sanic.request import Request
 | 
				
			||||||
from sanic.response import HTTPResponse, json
 | 
					from sanic.response import HTTPResponse, json
 | 
				
			||||||
from dependency_injector.wiring import Provide
 | 
					from dependency_injector.wiring import inject, Provide
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from .services import SearchService
 | 
					from .services import SearchService
 | 
				
			||||||
from .containers import Container
 | 
					from .containers import Container
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@inject
 | 
				
			||||||
async def index(
 | 
					async def index(
 | 
				
			||||||
        request: Request,
 | 
					        request: Request,
 | 
				
			||||||
        search_service: SearchService = Provide[Container.search_service],
 | 
					        search_service: SearchService = Provide[Container.search_service],
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user