fix(fc3c): distinct test JPEG colors so both attach (sha256 dedup was kicking in)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user