File size: 420 Bytes
c1d887c
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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")