Revize 3195e946
Přidáno uživatelem Jan Pašek před více než 3 roky(ů)
tests/integration_tests/rest_api/conftest.py | ||
---|---|---|
1 | 1 |
import pytest |
2 |
import app |
|
2 | 3 |
from app import app as flask_app |
4 |
from src.config import configuration |
|
5 |
from src.config.connection_provider import ConnectionProvider |
|
6 |
from src.controllers.certificates_controller import CertController |
|
3 | 7 |
from src.db.setup_database import setup_database |
8 |
from injector import Module, Annotated, inject, Injector |
|
4 | 9 |
|
5 | 10 |
|
6 | 11 |
@pytest.fixture(scope="session") |
7 | 12 |
def server(): |
13 |
injector = Injector([configuration.configure_default, ConnectionProvider]) |
|
14 |
app.certificate_controller = injector.get(CertController) |
|
15 |
|
|
8 | 16 |
setup_database() |
9 | 17 |
flask_app.testing = True |
10 | 18 |
with flask_app.test_client() as s: |
Také k dispozici: Unified diff
Re #8569 Fixed broken tests after injection implementation