mathpulse-api-v3test / tests /test_hash_utils.py
github-actions[bot]
🚀 Auto-deploy backend from GitHub (9923591)
c1d887c
raw
history blame contribute delete
420 Bytes
import pytest
from backend.utils.hash_utils import calculate_file_hash
def test_calculate_file_hash_consistency():
content = b"test educational content"
hash1 = calculate_file_hash(content)
hash2 = calculate_file_hash(content)
assert hash1 == hash2
assert len(hash1) == 64
def test_calculate_file_hash_uniqueness():
assert calculate_file_hash(b"content a") != calculate_file_hash(b"content b")