We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec3417a commit e601d09Copy full SHA for e601d09
python_test/test_config_manager.py
@@ -48,8 +48,15 @@ def test_backend_configuration_from_env(monkeypatch):
48
assert cfg.db.name == "testdb"
49
50
51
-def test_database_connection_string():
52
- db = settings.db
+def test_database_connection_string(monkeypatch):
+ monkeypatch.setenv("GS_DATABASE_USER", "testuser")
53
+ monkeypatch.setenv("GS_DATABASE_PASSWORD", "testpassword")
54
+ monkeypatch.setenv("GS_DATABASE_LOCATION", "localhost")
55
+ monkeypatch.setenv("GS_DATABASE_PORT", "5432")
56
+ monkeypatch.setenv("GS_DATABASE_NAME", "testdb")
57
+
58
+ cfg = BackendConfiguration()
59
+ db = cfg.db
60
61
assert db.password.get_secret_value() == "testpassword"
62
expected_url = "postgresql://testuser:testpassword@localhost:5432/testdb"
0 commit comments