fix(test): update FC-2b/2a tests that pinned pre-vii-c artist behavior

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-18 21:39:54 -04:00
parent 9d61f0da44
commit 80701dabf7
2 changed files with 12 additions and 8 deletions
+8 -7
View File
@@ -11,7 +11,7 @@ import pytest
from PIL import Image
from sqlalchemy import select
from backend.app.models import Artist, ImageRecord, ImportSettings, Tag, TagKind
from backend.app.models import Artist, ImageRecord, ImportSettings
from backend.app.services.importer import Importer, SkipReason
from backend.app.services.thumbnailer import Thumbnailer
@@ -62,21 +62,22 @@ def test_import_one_happy_path(importer, import_layout):
assert record.path.endswith(".jpg")
def test_folder_creates_artist_and_tag(importer, import_layout):
def test_folder_creates_artist_and_links_artist_id(importer, import_layout):
# FC-2d-vii-c: folder import creates the Artist and sets the canonical
# image_record.artist_id — no artist-kind Tag (that path was retired;
# the no-tag invariant is covered by test_importer_artist_id.py).
import_root, _ = import_layout
src = import_root / "Alice" / "first.jpg"
_make_jpeg(src)
importer.import_one(src)
result = importer.import_one(src)
artist = importer.session.execute(
select(Artist).where(Artist.slug == "alice")
).scalar_one()
assert artist.name == "Alice"
tag = importer.session.execute(
select(Tag).where(Tag.name == "Alice").where(Tag.kind == TagKind.artist)
).scalar_one()
assert tag.id is not None
record = importer.session.get(ImageRecord, result.image_id)
assert record.artist_id == artist.id
def test_dedup_by_hash(importer, import_layout):
+4 -1
View File
@@ -17,7 +17,10 @@ from backend.app.services.ml.tagger import (
def test_surfaced_categories():
assert SURFACED_CATEGORIES == {"artist", "character", "copyright", "general"}
# FC-2d-vii-c: 'artist' retired — artist identity is acquisition-derived
# (image_record.artist_id), never ML-inferred.
assert SURFACED_CATEGORIES == {"character", "copyright", "general"}
assert "artist" not in SURFACED_CATEGORIES
def test_store_floor_is_low():