Spaces:
Running
Running
Download tests/test_auth_config.py from Leon4gr45/brain: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/Leon4gr45/brain/resolve/main/tests/test_auth_config.py
- Command line
-
hf download hf://spaces/Leon4gr45/brain/tests/test_auth_config.py
-
curl -L -o test_auth_config.py https://huggingface.co/spaces/Leon4gr45/brain/resolve/main/tests/test_auth_config.py
1.03 kB
| import pytest | |
| from src.services.auth_config import resolve_system_pat | |
| def test_one_administrator(env, expected): | |
| assert resolve_system_pat(env) == expected | |
| def test_fail_closed(env, code): | |
| with pytest.raises(ValueError, match=code): | |
| resolve_system_pat(env) | |
| def test_legacy_alias_deprecation(caplog): | |
| from src.services.auth_config import _warn_legacy_alias | |
| _warn_legacy_alias.cache_clear() | |
| resolve_system_pat({'BRAINPAT_TOKEN': 'never-log-this'}) | |
| assert 'deprecated' in caplog.text | |
| assert 'never-log-this' not in caplog.text | |