File tree Expand file tree Collapse file tree 5 files changed +6
-11
lines changed
Expand file tree Collapse file tree 5 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 11# TODO:(335) Improve loading the configuration
22
3- from .cors_config import CORSConfig
4- from .database_config import DatabaseConfig
5- from .logger_config import LoggerConfig
3+ from gs . backend . config .cors_config import CORSConfig
4+ from gs . backend . config .database_config import DatabaseConfig
5+ from gs . backend . config .logger_config import LoggerConfig
66
77
88class BackendConfiguration :
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ class DatabaseConfig(BaseSettings):
1515 port : int
1616 name : str
1717
18+ @property
1819 def connection_string (self ) -> str :
1920 """
2021 Returns the database connection string
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def get_db_engine() -> Engine:
1313
1414 :return: engine
1515 """
16- return create_engine (settings .db .connection_string () )
16+ return create_engine (settings .db .connection_string )
1717
1818
1919def get_db_session () -> Session :
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def test_database_connection_string():
5454
5555 assert db .password .get_secret_value () == "testpassword"
5656 expected_url = "postgresql://testuser:testpassword@localhost:5432/testdb"
57- assert db .connection_string () == expected_url
57+ assert db .connection_string == expected_url
5858
5959
6060def test_database_missing_env (monkeypatch ):
You can’t perform that action at this time.
0 commit comments