Spaces:
Sleeping
Sleeping
Download tests/test_auth.py from thabsheeeeeer/DocBrain-API: direct link, hf CLI and curl.
- Browser
- Download file 424 Bytes
-
https://huggingface.co/spaces/thabsheeeeeer/DocBrain-API/resolve/main/tests/test_auth.py
- Command line
-
hf download hf://spaces/thabsheeeeeer/DocBrain-API/tests/test_auth.py
-
curl -L -o test_auth.py https://huggingface.co/spaces/thabsheeeeeer/DocBrain-API/resolve/main/tests/test_auth.py
424 Bytes
| from app.core.security import hash_password, verify_password, create_access_token | |
| def test_hash_password(): | |
| password = "Test@1234" | |
| hashed = hash_password(password) | |
| assert hashed != password | |
| assert verify_password(password, hashed) is True | |
| def test_create_access_token(): | |
| token = create_access_token({"sub": "1", "username": "testuser"}) | |
| assert isinstance(token, str) | |
| assert len(token) > 20 |