|
15 | 15 | POSTGRES_DEFAULT_GSS_ENCMODE, |
16 | 16 | ) |
17 | 17 |
|
| 18 | +from utils.checks import InvalidConfigurationError |
| 19 | + |
18 | 20 | from models.config import ( |
19 | 21 | AuthenticationConfiguration, |
20 | 22 | Configuration, |
|
31 | 33 | DatabaseConfiguration, |
32 | 34 | ) |
33 | 35 |
|
34 | | -from utils.checks import InvalidConfigurationError |
35 | | - |
36 | 36 |
|
37 | 37 | def test_service_configuration_constructor() -> None: |
38 | 38 | """ |
@@ -506,8 +506,9 @@ def test_configuration_multiple_mcp_servers() -> None: |
506 | 506 | def test_dump_configuration(tmp_path) -> None: |
507 | 507 | """ |
508 | 508 | 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. |
511 | 512 | """ |
512 | 513 | cfg = Configuration( |
513 | 514 | name="test_name", |
@@ -879,7 +880,7 @@ def test_authentication_configuration_module_unsupported() -> None: |
879 | 880 |
|
880 | 881 | def test_database_configuration(subtests) -> None: |
881 | 882 | """Test the database configuration handling.""" |
882 | | - with subtests.test(msg="PostgresSQL"): |
| 883 | + with subtests.test(msg="PostgreSQL"): |
883 | 884 | d1 = PostgreSQLDatabaseConfiguration( |
884 | 885 | db="db", |
885 | 886 | user="user", |
@@ -909,12 +910,16 @@ def test_no_databases_configuration() -> None: |
909 | 910 | d = DatabaseConfiguration() |
910 | 911 | assert d is not None |
911 | 912 |
|
| 913 | + # default should be SQLite when nothing is provided |
| 914 | + assert d.db_type == "sqlite" |
| 915 | + |
912 | 916 | # simulate no DB configuration |
913 | 917 | d.sqlite = None |
914 | 918 | d.postgres = None |
915 | 919 |
|
916 | 920 | 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 |
918 | 923 |
|
919 | 924 |
|
920 | 925 | def test_two_databases_configuration() -> None: |
|
0 commit comments