Spaces:
Sleeping
Sleeping
Download tests/test_hash.py from thabsheeeeeer/DocBrain-API: direct link, hf CLI and curl.
- Browser
- Download file 289 Bytes
-
https://huggingface.co/spaces/thabsheeeeeer/DocBrain-API/resolve/main/tests/test_hash.py
- Command line
-
hf download hf://spaces/thabsheeeeeer/DocBrain-API/tests/test_hash.py
-
curl -L -o test_hash.py https://huggingface.co/spaces/thabsheeeeeer/DocBrain-API/resolve/main/tests/test_hash.py
289 Bytes
| from app.utils.hash import generate_file_hash | |
| def test_generate_file_hash(tmp_path): | |
| file_path = tmp_path / "sample.txt" | |
| file_path.write_text("hello world") | |
| file_hash = generate_file_hash(str(file_path)) | |
| assert isinstance(file_hash, str) | |
| assert len(file_hash) == 64 |