Skip to content

Commit 8d4fc82

Browse files
committed
Minor fixes
1 parent a12f89e commit 8d4fc82

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

tests/unit/models/test_config.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
POSTGRES_DEFAULT_GSS_ENCMODE,
1616
)
1717

18+
from utils.checks import InvalidConfigurationError
19+
1820
from models.config import (
1921
AuthenticationConfiguration,
2022
Configuration,
@@ -31,8 +33,6 @@
3133
DatabaseConfiguration,
3234
)
3335

34-
from utils.checks import InvalidConfigurationError
35-
3636

3737
def test_service_configuration_constructor() -> None:
3838
"""
@@ -506,8 +506,9 @@ def test_configuration_multiple_mcp_servers() -> None:
506506
def test_dump_configuration(tmp_path) -> None:
507507
"""
508508
Test that the Configuration object can be serialized to a JSON file and
509-
that the resulting file contains all expected sections and values. It also
510-
checks if all keys and passwords were redacted.
509+
that the resulting file contains all expected sections and values.
510+
511+
Please note that redaction process is not in place.
511512
"""
512513
cfg = Configuration(
513514
name="test_name",
@@ -879,7 +880,7 @@ def test_authentication_configuration_module_unsupported() -> None:
879880

880881
def test_database_configuration(subtests) -> None:
881882
"""Test the database configuration handling."""
882-
with subtests.test(msg="PostgresSQL"):
883+
with subtests.test(msg="PostgreSQL"):
883884
d1 = PostgreSQLDatabaseConfiguration(
884885
db="db",
885886
user="user",
@@ -909,12 +910,16 @@ def test_no_databases_configuration() -> None:
909910
d = DatabaseConfiguration()
910911
assert d is not None
911912

913+
# default should be SQLite when nothing is provided
914+
assert d.db_type == "sqlite"
915+
912916
# simulate no DB configuration
913917
d.sqlite = None
914918
d.postgres = None
915919

916920
with pytest.raises(ValueError, match="No database configuration found"):
917-
d.db_type
921+
# access propery to call it's getter
922+
_ = d.db_type
918923

919924

920925
def test_two_databases_configuration() -> None:

0 commit comments

Comments
 (0)