1 |
a0d4dda1
|
Captain_Trojan
|
import pytest
|
2 |
d2b0ef43
|
Stanislav Král
|
from flask_injector import FlaskInjector
|
3 |
|
|
from injector import Injector
|
4 |
|
|
|
5 |
5b57121e
|
Captain_Trojan
|
from app import app as flask_app
|
6 |
d2b0ef43
|
Stanislav Král
|
from src.config.configuration import test_configuration_binder
|
7 |
3195e946
|
Jan Pašek
|
from src.config.connection_provider import ConnectionProvider
|
8 |
71938dcd
|
Captain_Trojan
|
from src.services.cryptography import CryptographyService
|
9 |
a0d4dda1
|
Captain_Trojan
|
|
10 |
|
|
|
11 |
|
|
@pytest.fixture(scope="session")
|
12 |
|
|
def server():
|
13 |
d2b0ef43
|
Stanislav Král
|
modules = [test_configuration_binder, ConnectionProvider]
|
14 |
|
|
injector = Injector(modules)
|
15 |
|
|
FlaskInjector(app=flask_app, modules=modules)
|
16 |
3195e946
|
Jan Pašek
|
|
17 |
5b57121e
|
Captain_Trojan
|
flask_app.testing = True
|
18 |
|
|
with flask_app.test_client() as s:
|
19 |
a0d4dda1
|
Captain_Trojan
|
yield s
|
20 |
71938dcd
|
Captain_Trojan
|
|
21 |
|
|
|
22 |
|
|
@pytest.fixture(scope="session")
|
23 |
|
|
def cryptography_service():
|
24 |
|
|
return CryptographyService()
|