Skip to content

Commit c840373

Browse files
Brain256Brain256
authored andcommitted
update unit test
1 parent 8b914a3 commit c840373

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

python_test/test_config_manager.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,18 @@ def test_cors_config_default():
2525

2626
def test_backend_configuration_from_env(monkeypatch):
2727
monkeypatch.setenv("LOGGER_EXCLUDED_ENDPOINTS", '["/test"]')
28+
2829
monkeypatch.setenv("CORS_ALLOW_ORIGINS", '["http://localhost:5173"]')
2930
monkeypatch.setenv("CORS_ALLOW_CREDENTIALS", "True")
3031
monkeypatch.setenv("CORS_ALLOW_METHODS", '["*"]')
3132
monkeypatch.setenv("CORS_ALLOW_HEADERS", '["*"]')
3233

34+
monkeypatch.setenv("GS_DATABASE_USER", "testuser")
35+
monkeypatch.setenv("GS_DATABASE_PASSWORD", "testpassword")
36+
monkeypatch.setenv("GS_DATABASE_LOCATION", "localhost")
37+
monkeypatch.setenv("GS_DATABASE_PORT", "5432")
38+
monkeypatch.setenv("GS_DATABASE_NAME", "testdb")
39+
3340
importlib.reload(config)
3441
cfg = config.settings
3542

@@ -51,6 +58,12 @@ def test_database_connection_string():
5158

5259

5360
def test_database_missing_env(monkeypatch):
61+
monkeypatch.setenv("GS_DATABASE_USER", "testuser")
62+
monkeypatch.setenv("GS_DATABASE_PASSWORD", "testpassword")
63+
monkeypatch.setenv("GS_DATABASE_LOCATION", "localhost")
64+
monkeypatch.setenv("GS_DATABASE_PORT", "5432")
65+
monkeypatch.setenv("GS_DATABASE_NAME", "testdb")
66+
5467
monkeypatch.delenv("GS_DATABASE_PASSWORD")
5568

5669
with pytest.raises(ValidationError):

0 commit comments

Comments
 (0)