Spaces:
Running on Zero
Running on Zero
Download tests/test_secrets.py from deveshc23/drift-quant: direct link, hf CLI and curl.
- Browser
- Download file 535 Bytes
-
https://huggingface.co/spaces/deveshc23/drift-quant/resolve/main/tests/test_secrets.py
- Command line
-
hf download hf://spaces/deveshc23/drift-quant/tests/test_secrets.py
-
curl -L -o test_secrets.py https://huggingface.co/spaces/deveshc23/drift-quant/resolve/main/tests/test_secrets.py
535 Bytes
| from __future__ import annotations | |
| import pytest | |
| from drift_quant.secrets import SecretConfigurationError, load_required_secret | |
| def test_secret_value_is_redacted_when_rendered() -> None: | |
| secret = load_required_secret("TEST_SECRET", {"TEST_SECRET": "not-for-logs"}) | |
| assert str(secret) == "[REDACTED]" | |
| assert "not-for-logs" not in repr(secret) | |
| def test_missing_secret_does_not_echo_value() -> None: | |
| with pytest.raises(SecretConfigurationError, match="TEST_SECRET"): | |
| load_required_secret("TEST_SECRET", {}) | |