Skip to content

Commit f44e1ac

Browse files
committed
LCORE-574: database config property test
1 parent eb937ce commit f44e1ac

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/unit/models/test_config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,7 @@ def test_database_configuration(subtests) -> None:
893893
assert d.sqlite is None
894894
assert d.postgres is not None
895895
assert d.db_type == "postgres"
896+
assert d.config == d1
896897

897898
with subtests.test(msg="SQLite"):
898899
d1 = SQLiteDatabaseConfiguration(
@@ -903,6 +904,7 @@ def test_database_configuration(subtests) -> None:
903904
assert d.sqlite is not None
904905
assert d.postgres is None
905906
assert d.db_type == "sqlite"
907+
assert d.config == d1
906908

907909

908910
def test_no_databases_configuration() -> None:
@@ -921,6 +923,10 @@ def test_no_databases_configuration() -> None:
921923
# access propery to call it's getter
922924
_ = d.db_type
923925

926+
with pytest.raises(ValueError, match="No database configuration found"):
927+
# access propery to call it's getter
928+
_ = d.config
929+
924930

925931
def test_two_databases_configuration() -> None:
926932
"""Test if two databases configuration is checked."""

0 commit comments

Comments
 (0)