Files
reactbin/api/tests/unit/test_hashing.py
agatha 8bf6ef443a [Spec Kit] Implementation progress
Implements all 88 tasks for the Reaction Image Board (specs/001-reaction-image-board):

- docker-compose.yml: postgres, minio, minio-init, api, ui services with healthchecks
- api/: FastAPI app with SQLAlchemy 2.x async, Alembic migrations, S3/MinIO storage,
  full integration + unit test suite (pytest + pytest-asyncio)
- ui/: Angular 19 standalone app (Library, Upload, Detail, NotFound components)
- .env.example: all required environment variables
- .gitignore: Python, Node, Docker, IDE, .env patterns

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 16:13:23 +00:00

21 lines
511 B
Python

import hashlib
from app.utils import compute_sha256
def test_sha256_known_bytes():
data = b"hello world"
expected = hashlib.sha256(data).hexdigest()
assert compute_sha256(data) == expected
def test_sha256_empty_bytes():
data = b""
expected = hashlib.sha256(data).hexdigest()
assert compute_sha256(data) == expected
def test_sha256_returns_64_char_hex():
result = compute_sha256(b"test data")
assert len(result) == 64
assert all(c in "0123456789abcdef" for c in result)