Skip to content

Commit 36639a4

Browse files
committed
udpates tests
1 parent bf4c29e commit 36639a4

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def test_settings_to_client_statics(app_settings: ApplicationSettings):
7474
def test_settings_to_client_statics_plugins(
7575
mock_webserver_service_environment: EnvVarsDict, monkeypatch: pytest.MonkeyPatch
7676
):
77+
# explicitly disable these plugins
7778
disable_plugins = {
7879
"WEBSERVER_EXPORTER",
7980
"WEBSERVER_SCICRUNCH",
@@ -84,18 +85,22 @@ def test_settings_to_client_statics_plugins(
8485
for name in disable_plugins:
8586
monkeypatch.setenv(name, "null")
8687

88+
# explicitly disable WEBSERVER_FOLDERS
8789
monkeypatch.setenv("WEBSERVER_FOLDERS", "0")
8890
disable_plugins.add("WEBSERVER_FOLDERS")
8991

92+
# set WEBSERVER_REALTIME_COLLABORATION (NOTE: WEBSERVER_DEV_FEATURES_ENABLED=True) )
9093
monkeypatch.setenv(
9194
"WEBSERVER_REALTIME_COLLABORATION", '{"RTC_MAX_NUMBER_OF_USERS":3}'
9295
)
9396
disable_plugins.remove("WEBSERVER_REALTIME_COLLABORATION")
9497

9598
settings = ApplicationSettings.create_from_envs()
96-
statics = settings.to_client_statics()
99+
assert settings.WEBSERVER_DEV_FEATURES_ENABLED
97100

98101
# -------------
102+
103+
statics = settings.to_client_statics()
99104
print("STATICS:\n", json_dumps(statics, indent=1))
100105

101106
assert settings.WEBSERVER_LOGIN
@@ -116,16 +121,18 @@ def test_settings_to_client_statics_plugins(
116121
== settings.WEBSERVER_SESSION.SESSION_COOKIE_MAX_AGE
117122
)
118123

119-
assert "WEBSERVER_REALTIME_COLLABORATION" in statics["pluginsDisabled"]
124+
assert statics["vcsReleaseTag"]
125+
assert TypeAdapter(HttpUrl).validate_python(statics["vcsReleaseUrl"])
126+
127+
# check WEBSERVER_REALTIME_COLLABORATION enabled
128+
assert "WEBSERVER_REALTIME_COLLABORATION" not in statics["pluginsDisabled"]
120129
assert settings.WEBSERVER_REALTIME_COLLABORATION
121130
assert (
122131
statics["webserverRealtimeCollaboration"]["RTC_MAX_NUMBER_OF_USERS"]
123132
== settings.WEBSERVER_REALTIME_COLLABORATION.RTC_MAX_NUMBER_OF_USERS
124133
)
125134

126-
assert statics["vcsReleaseTag"]
127-
assert TypeAdapter(HttpUrl).validate_python(statics["vcsReleaseUrl"])
128-
135+
# check disabled plugins
129136
assert set(statics["pluginsDisabled"]) == (disable_plugins)
130137

131138

0 commit comments

Comments
 (0)