File tree Expand file tree Collapse file tree 4 files changed +0
-90
lines changed
clusters-keeper/tests/unit
dynamic-scheduler/tests/unit Expand file tree Collapse file tree 4 files changed +0
-90
lines changed Original file line number Diff line number Diff line change 33# pylint: disable=redefined-outer-name
44
55
6- import pytest
76from pytest_simcore .helpers .monkeypatch_envs import (
87 EnvVarsDict ,
9- delenvs_from_dict ,
10- setenvs_from_dict ,
118)
129from simcore_service_api_server .core .settings import ApplicationSettings
1310
1411
15- @pytest .fixture
16- def app_environment (
17- monkeypatch : pytest .MonkeyPatch ,
18- app_environment : EnvVarsDict ,
19- external_envfile_dict : EnvVarsDict ,
20- ) -> EnvVarsDict :
21- """OVERRIDES app_environment fixture:
22-
23- Enables using external envfiles (e.g. repo.config files) to run tests against
24- within this test module.
25- """
26- if external_envfile_dict :
27- delenvs_from_dict (monkeypatch , app_environment , raising = False )
28- return setenvs_from_dict (
29- monkeypatch ,
30- {** external_envfile_dict },
31- )
32- return app_environment
33-
34-
3512def test_valid_application_settings (app_environment : EnvVarsDict ):
3613 assert app_environment
3714
Original file line number Diff line number Diff line change 1111from pydantic import ValidationError
1212from pytest_simcore .helpers .monkeypatch_envs import (
1313 EnvVarsDict ,
14- delenvs_from_dict ,
1514 setenvs_from_dict ,
1615)
1716from simcore_service_clusters_keeper .core .settings import ApplicationSettings
@@ -118,25 +117,10 @@ def test_valid_primary_custom_tags(
118117
119118def test_valid_application_settings (
120119 monkeypatch : pytest .MonkeyPatch ,
121- external_envfile_dict : EnvVarsDict ,
122120 app_environment : EnvVarsDict ,
123121):
124- """
125- We validate actual envfiles (e.g. repo.config files) by passing them via the CLI
126-
127- $ ln -s /path/to/osparc-config/deployments/mydeploy.com/repo.config .secrets
128- $ pytest --external-envfile=.secrets --pdb tests/unit/test_core_settings.py
129-
130- """
131-
132122 # Mock
133123 assert app_environment
134- if external_envfile_dict :
135- delenvs_from_dict (monkeypatch , app_environment , raising = False )
136- setenvs_from_dict (
137- monkeypatch ,
138- {** external_envfile_dict },
139- )
140124
141125 # Test
142126 settings = ApplicationSettings () # type: ignore
Original file line number Diff line number Diff line change 1616import pytest
1717from pydantic import ValidationError
1818from pytest_simcore .helpers .monkeypatch_envs import (
19- delenvs_from_dict ,
2019 setenvs_from_dict ,
2120 setenvs_from_envfile ,
2221)
2322from pytest_simcore .helpers .typing_env import EnvVarsDict
2423from simcore_service_director .core .settings import ApplicationSettings
2524
2625
27- @pytest .fixture
28- def app_environment (
29- monkeypatch : pytest .MonkeyPatch ,
30- app_environment : EnvVarsDict ,
31- external_envfile_dict : EnvVarsDict ,
32- ) -> EnvVarsDict :
33- """OVERRIDES app_environment fixture:
34-
35- Enables using external envfiles (e.g. repo.config files) to run tests against
36- within this test module.
37- """
38- if external_envfile_dict :
39- delenvs_from_dict (monkeypatch , app_environment , raising = False )
40- return setenvs_from_dict (
41- monkeypatch ,
42- {** external_envfile_dict },
43- )
44- return app_environment
45-
46-
4726def test_valid_application_settings (app_environment : EnvVarsDict ):
4827 settings = ApplicationSettings () # type: ignore
4928 assert settings
Original file line number Diff line number Diff line change 11# pylint: disable=unused-variable
22# pylint: disable=unused-argument
33# pylint: disable=redefined-outer-name
4- """
5- We validate actual envfiles (e.g. repo.config files) by passing them via the CLI
64
7- $ ln -s /path/to/osparc-config/deployments/mydeploy.com/repo.config .secrets
8- $ pytest --external-envfile=.secrets --pdb tests/unit/test_core_settings.py
95
10- """
11-
12-
13- import pytest
146from pytest_simcore .helpers .monkeypatch_envs import (
157 EnvVarsDict ,
16- delenvs_from_dict ,
17- setenvs_from_dict ,
188)
199from simcore_service_dynamic_scheduler .core .settings import ApplicationSettings
2010
2111
22- @pytest .fixture
23- def app_environment (
24- monkeypatch : pytest .MonkeyPatch ,
25- app_environment : EnvVarsDict ,
26- external_envfile_dict : EnvVarsDict ,
27- ) -> EnvVarsDict :
28- """OVERRIDES app_environment fixture:
29-
30- Enables using external envfiles (e.g. repo.config files) to run tests against
31- within this test module.
32- """
33- if external_envfile_dict :
34- delenvs_from_dict (monkeypatch , app_environment , raising = False )
35- return setenvs_from_dict (
36- monkeypatch ,
37- {** external_envfile_dict },
38- )
39- return app_environment
40-
41-
4212def test_valid_application_settings (app_environment : EnvVarsDict ):
4313 assert app_environment
4414
You can’t perform that action at this time.
0 commit comments