Goon — self-hosted aggregator for adult-content scene metadata. Indexes scenes from TPDB, StashDB, and 30+ public adult tube sites. Cross-source deduplication via perceptual hash + Levenshtein distance. FastAPI backend + APScheduler worker + React Native (Expo) mobile client. FOSS, ad-free, donation-funded. See README for details.
32 lines
951 B
Python
32 lines
951 B
Python
"""Sanity: normalize_scene propaguje fingerprints i cross_source_refs (M3)."""
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from app.connectors.stashdb import _parse_scene as parse_stashdb
|
|
from app.normalize.scenes import normalize_scene
|
|
|
|
|
|
@pytest.fixture
|
|
def stashdb_raw() -> dict:
|
|
return json.loads(
|
|
(Path(__file__).parent / "fixtures" / "stashdb_scene.json").read_text()
|
|
)
|
|
|
|
|
|
def test_normalize_carries_fingerprints(stashdb_raw: dict) -> None:
|
|
raw = parse_stashdb(stashdb_raw)
|
|
assert raw is not None
|
|
norm = normalize_scene(raw)
|
|
kinds = {kind for kind, _ in norm.fingerprints}
|
|
assert kinds == {"phash", "oshash"}
|
|
|
|
|
|
def test_normalize_carries_cross_source_refs(stashdb_raw: dict) -> None:
|
|
raw = parse_stashdb(stashdb_raw)
|
|
assert raw is not None
|
|
norm = normalize_scene(raw)
|
|
assert norm.cross_source_refs == {"tpdb": "11111111-1111-4111-8111-111111111111"}
|