fix(fc5): ruff (E712, ASYNC230/240, I001) + Credential.credential_type + FileStorage in api_migrate test

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-22 13:20:42 -04:00
parent 26fd3f9f2c
commit e5885f85c5
4 changed files with 36 additions and 30 deletions
+6 -3
View File
@@ -18,7 +18,7 @@ async def verify_async(db: AsyncSession, *, expected: dict | None = None) -> dic
checks = {
"artist_subscriptions": (
select(func.count(Artist.id)).where(Artist.is_subscription == True)
select(func.count(Artist.id)).where(Artist.is_subscription.is_(True))
),
"source_count": select(func.count(Source.id)),
"credential_count": select(func.count(Credential.id)),
@@ -51,12 +51,15 @@ async def verify_sha256_sample(
samples: list[dict] = []
for img_id, path, expected_sha in rows:
p = Path(path)
if not p.exists():
# Sync stdlib filesystem ops are intentional: this verify pass runs
# inside a Celery task under asyncio.run; no other awaitables compete
# for the loop. Same pattern as download_service.py.
if not p.exists(): # noqa: ASYNC240
missing += 1
samples.append({"id": img_id, "path": path, "result": "missing"})
continue
h = hashlib.sha256()
with p.open("rb") as f:
with p.open("rb") as f: # noqa: ASYNC230
for chunk in iter(lambda: f.read(65536), b""):
h.update(chunk)
if h.hexdigest() == expected_sha: