def test_from_path_in_env_delayed(self, ini_file):
        """`from_path_in_env` prepares for loading but doesn't load until
        `to_config` runs."""
        secret = INISecrets.from_path_in_env("APP_SECRETS_INI").secret

        @environ.config
        class Cfg(object):
            password = secret()

        cfg = environ.to_config(Cfg, {"APP_SECRETS_INI": str(ini_file)})

        assert "foobar" == cfg.password
Esempio n. 2
0
def ini(ini_file):
    return INISecrets.from_path(str(ini_file))