from importarr.config import Settings def test_file_secret_env_vars_are_supported(tmp_path, monkeypatch): sab_key = tmp_path / "sab-api-key" auth_token = tmp_path / "auth-token" sab_key.write_text("sab-secret\n", encoding="utf-8") auth_token.write_text("auth-secret\n", encoding="utf-8") monkeypatch.setenv("IMPORTARR_SAB_API_KEY_FILE", str(sab_key)) monkeypatch.setenv("IMPORTARR_AUTH_TOKEN_FILE", str(auth_token)) monkeypatch.setenv("IMPORTARR_STATE_PATH", str(tmp_path / "state.db")) settings = Settings.from_env() assert settings.sab_api_key == "sab-secret" assert settings.auth_token == "auth-secret"