You've already forked RekomenciBackend
add edit resume
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from collections.abc import Callable
|
||||
from collections.abc import AsyncIterable, Callable
|
||||
from inspect import Parameter
|
||||
from typing import Final
|
||||
|
||||
@@ -13,7 +13,8 @@ from dishka import (
|
||||
)
|
||||
from dishka.integrations.base import wrap_injection
|
||||
from dishka.integrations.fastapi import FastapiProvider
|
||||
from httpx import AsyncClient
|
||||
from fastapi import FastAPI
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
from sqlalchemy import text
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
@@ -71,11 +72,13 @@ class TestProvider(Provider):
|
||||
database_clearer = provide(DatabaseClearer)
|
||||
|
||||
@provide
|
||||
def http_client(self) -> AsyncClient:
|
||||
return AsyncClient(base_url="http://backend:8080")
|
||||
async def http_client(self, app: FastAPI) -> AsyncIterable[AsyncClient]:
|
||||
transport = ASGITransport(app=app)
|
||||
async with AsyncClient(transport=transport, base_url="http://testserver") as client:
|
||||
yield client
|
||||
|
||||
|
||||
def make_ioc(configuration: Configuration) -> AsyncContainer:
|
||||
def make_ioc(configuration: Configuration, app: FastAPI) -> AsyncContainer:
|
||||
return make_async_container(
|
||||
IdPProvider(),
|
||||
FactoryProvider(),
|
||||
@@ -97,6 +100,7 @@ def make_ioc(configuration: Configuration) -> AsyncContainer:
|
||||
FirebaseConfiguration: configuration.firebase,
|
||||
Configuration: configuration,
|
||||
S3Config: configuration.s3,
|
||||
FastAPI: app,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user