Revize d2b0ef43
Přidáno uživatelem Stanislav Král před asi 4 roky(ů)
src/config/configuration.py | ||
---|---|---|
3 | 3 |
import configparser |
4 | 4 |
from injector import singleton |
5 | 5 |
|
6 |
from src.constants import DEFAULT_CONNECTION_STRING |
|
6 |
from src.constants import DEFAULT_CONNECTION_STRING, TEST_DATABASE_FILE
|
|
7 | 7 |
|
8 | 8 |
DATABASE_SECTION = "Database" |
9 | 9 |
DATABASE_CONNECTION_STRING = "ConnectionString" |
... | ... | |
23 | 23 |
self.connection_string = DEFAULT_CONNECTION_STRING |
24 | 24 |
|
25 | 25 |
|
26 |
def test_configuration(): |
|
27 |
conf = Configuration() |
|
28 |
conf.connection_string = TEST_DATABASE_FILE |
|
29 |
return conf |
|
30 |
|
|
31 |
|
|
32 |
def test_configuration_binder(binder): |
|
33 |
binder.bind(Configuration, to=test_configuration(), scope=singleton) |
|
34 |
|
|
35 |
|
|
26 | 36 |
def configure_env_variable(binder): |
27 | 37 |
""" |
28 | 38 |
Load configuration file stored in X509_CONFIG environment variable. |
Také k dispozici: Unified diff
Re #8475 - Applied FlaskInjector to REST API tests