Skip to content

Commit 5e1d302

Browse files
committed
adds tests
1 parent b5755df commit 5e1d302

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

services/web/server/src/simcore_service_webserver/application_settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ def build_vcs_release_url_if_unset(cls, values):
323323
# TODO: consider mark as dev-feature in field extras of Config attr.
324324
# Then they can be automtically advertised
325325
"WEBSERVER_META_MODELING",
326+
"WEBSERVER_TRASH",
326327
"WEBSERVER_VERSION_CONTROL",
327328
mode="before",
328329
)

services/web/server/tests/unit/isolated/test_application_settings.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,25 @@ def test_settings_to_client_statics_plugins(
103103
assert set(statics["pluginsDisabled"]) == (disable_plugins | {"WEBSERVER_CLUSTERS"})
104104

105105

106+
@pytest.mark.parametrize("is_dev_feature_enabled", [True, False])
107+
def test_settings_to_client_statics_for_webserver_trash(
108+
is_dev_feature_enabled: bool,
109+
mock_webserver_service_environment: EnvVarsDict,
110+
monkeypatch: pytest.MonkeyPatch,
111+
):
112+
monkeypatch.setenv(
113+
"WEBSERVER_DEV_FEATURES_ENABLED", f"{is_dev_feature_enabled}".lower()
114+
)
115+
116+
settings = ApplicationSettings.create_from_envs()
117+
statics = settings.to_client_statics()
118+
119+
if is_dev_feature_enabled:
120+
assert "WEBSERVER_TRASH" not in set(statics["pluginsDisabled"])
121+
else:
122+
assert "WEBSERVER_TRASH" in set(statics["pluginsDisabled"])
123+
124+
106125
def test_avoid_sensitive_info_in_public(app_settings: ApplicationSettings):
107126
# avoids display of sensitive info
108127
assert not any("pass" in key for key in app_settings.public_dict())

0 commit comments

Comments
 (0)