From c212691771786061115e20a074e45d34a817b6d1 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 20 May 2026 22:39:27 -0400 Subject: [PATCH] fix(fc3c): distinct test JPEG colors so both attach (sha256 dedup was kicking in) Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/test_download_service.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_download_service.py b/tests/test_download_service.py index 496a3a6..9456d87 100644 --- a/tests/test_download_service.py +++ b/tests/test_download_service.py @@ -34,10 +34,10 @@ async def seed_artist_and_source(db, db_sync): return artist, source -def _make_jpg(path: Path): +def _make_jpg(path: Path, color=(100, 100, 100)): from PIL import Image path.parent.mkdir(parents=True, exist_ok=True) - Image.new("RGB", (32, 32), (100, 100, 100)).save(path, "JPEG") + Image.new("RGB", (32, 32), color).save(path, "JPEG") def _make_fake_dl_result( @@ -90,8 +90,9 @@ async def test_download_source_attaches_written_files( images_root = tmp_path / "images" f1 = images_root / "alice" / "patreon" / "post" / "a.jpg" f2 = images_root / "alice" / "patreon" / "post" / "b.jpg" - _make_jpg(f1) - _make_jpg(f2) + # Distinct colors → distinct sha256 → both attach (not deduped). + _make_jpg(f1, color=(200, 50, 50)) + _make_jpg(f2, color=(50, 50, 200)) fake_gdl = _fake_gdl_with_result(_make_fake_dl_result( success=True,