-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
47 lines (34 loc) · 935 Bytes
/
Copy pathconftest.py
File metadata and controls
47 lines (34 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from unittest.mock import Mock
import pytest
from fastapi import FastAPI
from httpx2 import ASGITransport, AsyncClient
from app.modules.accounts.application.containers import AppContainer
from app.modules.accounts.entrypoints import routes
from app.modules.accounts.infrastructure.containers import QueriesContainer
@pytest.fixture(autouse=True)
def container():
container = AppContainer()
container.wire(
[
".dependencies",
".routes",
],
)
return container
@pytest.fixture(autouse=True)
def queries_container():
container = QueriesContainer(engine=Mock())
container.wire(
[
".routes",
],
)
return container
@pytest.fixture
def app():
app = FastAPI()
app.include_router(routes.router)
return app
@pytest.fixture
def client(app):
return AsyncClient(transport=ASGITransport(app=app), base_url="http://test")