Skip to content

Commit e601d09

Browse files
Brain256Brain256
authored andcommitted
update unit tests again
1 parent ec3417a commit e601d09

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

python_test/test_config_manager.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,15 @@ def test_backend_configuration_from_env(monkeypatch):
4848
assert cfg.db.name == "testdb"
4949

5050

51-
def test_database_connection_string():
52-
db = settings.db
51+
def test_database_connection_string(monkeypatch):
52+
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
5360

5461
assert db.password.get_secret_value() == "testpassword"
5562
expected_url = "postgresql://testuser:testpassword@localhost:5432/testdb"

0 commit comments

Comments
 (0)