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 |
a0d4dda1
|
Captain_Trojan
|
|
9 |
|
|
|
10 |
|
|
@pytest.fixture(scope="session")
|
11 |
|
|
def server():
|
12 |
d2b0ef43
|
Stanislav Král
|
modules = [test_configuration_binder, ConnectionProvider]
|
13 |
|
|
injector = Injector(modules)
|
14 |
|
|
FlaskInjector(app=flask_app, modules=modules)
|
15 |
3195e946
|
Jan Pašek
|
|
16 |
5b57121e
|
Captain_Trojan
|
flask_app.testing = True
|
17 |
|
|
with flask_app.test_client() as s:
|
18 |
a0d4dda1
|
Captain_Trojan
|
yield s
|