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
6+
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
9+
10+ """
411
512
613import pytest
@@ -18,12 +25,10 @@ def app_environment(
1825 app_environment : EnvVarsDict ,
1926 external_envfile_dict : EnvVarsDict ,
2027) -> EnvVarsDict :
21- """
22- NOTE: To run against repo.config in osparc-config repo
23-
24- ln -s /path/to/osparc-config/deployments/mydeploy.com/repo.config .secrets
25- pytest --external-envfile=.secrets tests/unit/test_core_settings.py
28+ """OVERRIDES app_environment fixture:
2629
30+ Enables using external envfiles (e.g. repo.config files) to run tests against
31+ within this test module.
2732 """
2833 if external_envfile_dict :
2934 delenvs_from_dict (monkeypatch , app_environment , raising = False )
@@ -34,9 +39,11 @@ def app_environment(
3439 return app_environment
3540
3641
37- def test_unit_app_environment (app_environment : EnvVarsDict ):
42+ def test_valid_application_settings (app_environment : EnvVarsDict ):
3843 assert app_environment
39- settings = ApplicationSettings .create_from_envs ()
40- print ("captured settings: \n " , settings .model_dump_json (indent = 2 ))
44+
45+ settings = ApplicationSettings () # type: ignore
46+ assert settings
47+ assert settings == ApplicationSettings .create_from_envs ()
4148
4249 assert settings .PENNSIEVE
0 commit comments