Projekt

Obecné

Profil

Stáhnout (626 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1
import pytest
2
import app
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
7
from src.db.setup_database import setup_database
8
from injector import Module, Annotated, inject, Injector
9

    
10

    
11
@pytest.fixture(scope="session")
12
def server():
13
    injector = Injector([configuration.configure_default, ConnectionProvider])
14
    app.certificate_controller = injector.get(CertController)
15

    
16
    setup_database()
17
    flask_app.testing = True
18
    with flask_app.test_client() as s:
19
        yield s
(3-3/3)