The image and audio upload codepaths now use content-addressed (SHA-256) keys, but the key construction logic is untested.
What to test:
- Image key:
questions/{uuid}/{sha256hex16}.png (in internal/jobs/generate_image.go)
- Audio key:
{sessionID}/{messageID}/{sha256hex16}.{ext} (in internal/backend/turn.go)
Suggested approach:
Extract key-building into small pure functions and unit test them directly — deterministic input bytes should produce deterministic keys, identical content should produce identical keys, different content should produce different keys.
No integration test or mock wiring needed — just test the pure key construction.
The image and audio upload codepaths now use content-addressed (SHA-256) keys, but the key construction logic is untested.
What to test:
questions/{uuid}/{sha256hex16}.png(ininternal/jobs/generate_image.go){sessionID}/{messageID}/{sha256hex16}.{ext}(ininternal/backend/turn.go)Suggested approach:
Extract key-building into small pure functions and unit test them directly — deterministic input bytes should produce deterministic keys, identical content should produce identical keys, different content should produce different keys.
No integration test or mock wiring needed — just test the pure key construction.